parent
da271a45ae
commit
cb90fd41b0
@ -1,132 +0,0 @@
|
||||
.commentContainer {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.commentButton {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
padding: 4px;
|
||||
color: var(--ifm-color-emphasis-600);
|
||||
transition: all 0.2s ease;
|
||||
opacity: 1;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.commentButton:hover {
|
||||
color: var(--ifm-color-primary);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.commentPanel {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
width: 300px;
|
||||
background: var(--ifm-background-color);
|
||||
border: 1px solid var(--ifm-color-emphasis-200);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
z-index: 1000;
|
||||
margin-top: 8px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.commentList {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.commentItem {
|
||||
padding: 8px;
|
||||
border-bottom: 1px solid var(--ifm-color-emphasis-200);
|
||||
}
|
||||
|
||||
.commentItem:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.commentHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.commentAuthor {
|
||||
font-weight: 500;
|
||||
color: var(--ifm-color-primary);
|
||||
}
|
||||
|
||||
.commentTime {
|
||||
font-size: 12px;
|
||||
color: var(--ifm-color-emphasis-600);
|
||||
}
|
||||
|
||||
.deleteButton {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--ifm-color-emphasis-600);
|
||||
cursor: pointer;
|
||||
padding: 0 4px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.deleteButton:hover {
|
||||
color: var(--ifm-color-danger);
|
||||
}
|
||||
|
||||
.commentText {
|
||||
font-size: 14px;
|
||||
line-height: 1.4;
|
||||
color: var(--ifm-color-emphasis-800);
|
||||
}
|
||||
|
||||
.commentInput {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.commentInput textarea {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--ifm-color-emphasis-200);
|
||||
border-radius: 4px;
|
||||
resize: vertical;
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.commentInput textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--ifm-color-primary);
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
align-self: flex-end;
|
||||
padding: 6px 12px;
|
||||
background-color: var(--ifm-color-primary);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.submitButton:hover {
|
||||
background-color: var(--ifm-color-primary-darker);
|
||||
}
|
||||
|
||||
/* 删除鼠标悬停显示按钮的样式 */
|
||||
/* :global(.menu__link-wrapper:hover) .commentButton {
|
||||
opacity: 1;
|
||||
} */
|
@ -0,0 +1,97 @@
|
||||
YYYY.commentSection {
|
||||
margin-top: 3rem;
|
||||
padding-top: 2rem;
|
||||
border-top: 1px solid var(--ifm-color-emphasis-200);
|
||||
}
|
||||
|
||||
.commentTitle {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
color: var(--ifm-color-emphasis-800);
|
||||
}
|
||||
|
||||
.commentList {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.commentItem {
|
||||
padding: 1rem;
|
||||
border: 1px solid var(--ifm-color-emphasis-200);
|
||||
border-radius: 8px;
|
||||
margin-bottom: 1rem;
|
||||
background-color: var(--ifm-background-color);
|
||||
}
|
||||
|
||||
.commentHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.commentAuthor {
|
||||
font-weight: 500;
|
||||
color: var(--ifm-color-primary);
|
||||
}
|
||||
|
||||
.commentTime {
|
||||
font-size: 0.875rem;
|
||||
color: var(--ifm-color-emphasis-600);
|
||||
}
|
||||
|
||||
.deleteButton {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--ifm-color-emphasis-600);
|
||||
cursor: pointer;
|
||||
padding: 0 4px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.deleteButton:hover {
|
||||
color: var(--ifm-color-danger);
|
||||
}
|
||||
|
||||
.commentText {
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: var(--ifm-color-emphasis-800);
|
||||
}
|
||||
|
||||
.commentInput {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.commentInput textarea {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--ifm-color-emphasis-200);
|
||||
border-radius: 8px;
|
||||
resize: vertical;
|
||||
font-family: inherit;
|
||||
font-size: 1rem;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.commentInput textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--ifm-color-primary);
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
align-self: flex-end;
|
||||
padding: 0.5rem 1.5rem;
|
||||
background-color: var(--ifm-color-primary);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.submitButton:hover {
|
||||
background-color: var(--ifm-color-primary-darker);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
import DocItem from '@theme-original/DocItem';
|
||||
import DocComment from '@site/src/components/DocComment';
|
||||
|
||||
export default function DocItemWrapper(props) {
|
||||
return (
|
||||
<>
|
||||
<DocItem {...props} />
|
||||
<DocComment docId={props.content.metadata.id} />
|
||||
</>
|
||||
);
|
||||
}
|
Loading…
Reference in new issue