feat: add scrollbar style
This commit is contained in:
parent
e3dcfef024
commit
f7c5c1551a
@ -98,3 +98,32 @@ body,
|
||||
#inputbar .ant-input {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
||||
/* 全局初始化滚动条样式 */
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
/* Safari 和 Chrome */
|
||||
@media screen and (-webkit-min-device-pixel-ratio: 0) {
|
||||
body {
|
||||
scrollbar-width: thin; /* 告诉 FF 用细滚动条 */
|
||||
scrollbar-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.1); /* FF 前面色后面色 */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ const CodeBlock: React.FC<CodeBlockProps> = ({ children, className, ...rest }) =
|
||||
{...rest}
|
||||
language={match[1]}
|
||||
style={atomDark}
|
||||
wrapLongLines={true}
|
||||
customStyle={{ borderTopLeftRadius: 0, borderTopRightRadius: 0, marginTop: 0 }}>
|
||||
{String(children).replace(/\n$/, '')}
|
||||
</SyntaxHighlighter>
|
||||
|
||||
@ -108,14 +108,11 @@ const Messages: FC<Props> = ({ assistant, topic }) => {
|
||||
const Container = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: scroll;
|
||||
overflow-y: auto;
|
||||
flex-direction: column-reverse;
|
||||
max-height: calc(100vh - var(--input-bar-height) - var(--navbar-height));
|
||||
padding-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
|
||||
export default Messages
|
||||
|
||||
@ -112,6 +112,7 @@ const Container = styled.div`
|
||||
height: 100%;
|
||||
border-left: 0.5px solid var(--color-border);
|
||||
padding: 10px;
|
||||
overflow-y: auto;
|
||||
&.collapsed {
|
||||
width: 0;
|
||||
border-left: none;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user