mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +00:00
feat(styles): add themed scrollbars for improved dark mode experience
This commit is contained in:
@@ -5,6 +5,44 @@
|
||||
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Scrollbars — themed instead of the raw OS default, so a dark page doesn't
|
||||
carry a stark white scrollbar (or vice versa). Firefox via scrollbar-color,
|
||||
Chrome/Safari/Edge via the ::-webkit-scrollbar-* pseudo-elements. Colors
|
||||
come from Mantine's dark palette so they track the active color scheme
|
||||
instead of a fixed gray.
|
||||
--------------------------------------------------------------------------- */
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--mantine-color-gray-5) transparent;
|
||||
}
|
||||
[data-mantine-color-scheme='dark'] * {
|
||||
scrollbar-color: var(--mantine-color-dark-3) transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: var(--mantine-color-gray-5);
|
||||
border-radius: 8px;
|
||||
border: 2px solid transparent;
|
||||
background-clip: content-box;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: var(--mantine-color-gray-6);
|
||||
}
|
||||
[data-mantine-color-scheme='dark'] ::-webkit-scrollbar-thumb {
|
||||
background-color: var(--mantine-color-dark-3);
|
||||
}
|
||||
[data-mantine-color-scheme='dark'] ::-webkit-scrollbar-thumb:hover {
|
||||
background-color: var(--mantine-color-dark-2);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Print — the review dossier.
|
||||
|
||||
|
||||
@@ -2,3 +2,41 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Scrollbars — themed instead of the raw OS default, so a dark page doesn't
|
||||
carry a stark white scrollbar (or vice versa). Firefox via scrollbar-color,
|
||||
Chrome/Safari/Edge via the ::-webkit-scrollbar-* pseudo-elements. Colors
|
||||
come from Mantine's dark palette so they track the active color scheme
|
||||
instead of a fixed gray.
|
||||
--------------------------------------------------------------------------- */
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--mantine-color-gray-5) transparent;
|
||||
}
|
||||
[data-mantine-color-scheme='dark'] * {
|
||||
scrollbar-color: var(--mantine-color-dark-3) transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: var(--mantine-color-gray-5);
|
||||
border-radius: 8px;
|
||||
border: 2px solid transparent;
|
||||
background-clip: content-box;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: var(--mantine-color-gray-6);
|
||||
}
|
||||
[data-mantine-color-scheme='dark'] ::-webkit-scrollbar-thumb {
|
||||
background-color: var(--mantine-color-dark-3);
|
||||
}
|
||||
[data-mantine-color-scheme='dark'] ::-webkit-scrollbar-thumb:hover {
|
||||
background-color: var(--mantine-color-dark-2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user