style: add hover style for scrollbar (#2867)
This commit is contained in:
@@ -191,20 +191,30 @@ input[type='number']::-webkit-outer-spin-button {
|
|||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
.affine-default-viewport::-webkit-scrollbar {
|
.affine-default-viewport::-webkit-scrollbar {
|
||||||
width: 8px; /* Chrome Safari */
|
width: 20px; /* Chrome Safari */
|
||||||
|
height: 20px;
|
||||||
}
|
}
|
||||||
.affine-default-viewport::-webkit-scrollbar-thumb {
|
.affine-default-viewport::-webkit-scrollbar-thumb {
|
||||||
border-radius: 4px;
|
border-radius: 12px;
|
||||||
|
background-clip: padding-box;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 7px;
|
||||||
|
border-color: transparent;
|
||||||
|
transition: all 0.2s;
|
||||||
}
|
}
|
||||||
.affine-default-viewport:hover::-webkit-scrollbar-thumb {
|
.affine-default-viewport:hover::-webkit-scrollbar-thumb {
|
||||||
background-color: var(--affine-black-30);
|
background-color: var(--affine-divider-color);
|
||||||
}
|
}
|
||||||
|
.affine-default-viewport:hover::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: var(--affine-icon-color);
|
||||||
|
border-width: 5px;
|
||||||
|
}
|
||||||
.editor-wrapper {
|
.editor-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
padding-right: 8px;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* issue: https://github.com/toeverything/AFFiNE/issues/2004 */
|
/* issue: https://github.com/toeverything/AFFiNE/issues/2004 */
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
import { globalStyle, style } from '@vanilla-extract/css';
|
import { globalStyle, style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const scrollableContainerRoot = style({
|
export const scrollableContainerRoot = style({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
vars: {
|
vars: {
|
||||||
'--scrollbar-width': '10px',
|
'--scrollbar-width': '8px',
|
||||||
},
|
},
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const scrollTopBorder = style({
|
export const scrollTopBorder = style({
|
||||||
@@ -32,7 +29,6 @@ export const scrollableViewport = style({
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
globalStyle(`${scrollableViewport} > div`, {
|
globalStyle(`${scrollableViewport} > div`, {
|
||||||
maxWidth: '100%',
|
maxWidth: '100%',
|
||||||
display: 'block !important',
|
display: 'block !important',
|
||||||
@@ -48,12 +44,16 @@ export const scrollbar = style({
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
touchAction: 'none',
|
touchAction: 'none',
|
||||||
padding: '0 2px',
|
|
||||||
marginRight: '4px',
|
marginRight: '4px',
|
||||||
width: 'var(--scrollbar-width)',
|
width: 'var(--scrollbar-width)',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
transition: 'opacity .15s',
|
transition: 'width .15s',
|
||||||
|
':hover': {
|
||||||
|
background: 'var(--affine-background-secondary-color)',
|
||||||
|
width: 'calc(var(--scrollbar-width) + 3px)',
|
||||||
|
borderLeft: '1px solid var(--affine-border-color)',
|
||||||
|
},
|
||||||
selectors: {
|
selectors: {
|
||||||
'&[data-state="hidden"]': {
|
'&[data-state="hidden"]': {
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
@@ -67,8 +67,12 @@ export const TableScrollbar = style({
|
|||||||
|
|
||||||
export const scrollbarThumb = style({
|
export const scrollbarThumb = style({
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
background: 'var(--affine-black-30)',
|
background: 'var(--affine-divider-color)',
|
||||||
|
width: '50%',
|
||||||
borderRadius: '4px',
|
borderRadius: '4px',
|
||||||
|
':hover': {
|
||||||
|
background: 'var(--affine-icon-color)',
|
||||||
|
},
|
||||||
selectors: {
|
selectors: {
|
||||||
'&::before': {
|
'&::before': {
|
||||||
content: '""',
|
content: '""',
|
||||||
|
|||||||
Reference in New Issue
Block a user