discourse/plugins/chat/assets/stylesheets/mixins/chat-scrollbar.scss
Jarek Radosz b47e429b26
DEV: Fix mixed-decls sass deprecations in plugins (#31356)
A follow-up to #31343.

```
WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls
```
2025-02-18 20:04:51 +01:00

50 lines
1.1 KiB
SCSS
Vendored

@mixin chat-scrollbar() {
--scrollbarBg: transparent;
--scrollbarThumbBg: var(--primary-low);
--scrollbarWidth: 10px;
scrollbar-color: transparent var(--scrollbarBg);
transition: scrollbar-color 0.25s ease-in-out;
@content;
// chrome, safari
&::-webkit-scrollbar-thumb {
background-color: var(--scrollbarThumbBg);
border-radius: calc(var(--scrollbarWidth) / 2);
border: calc(var(--scrollbarWidth) / 4) solid var(--secondary);
}
&::-webkit-scrollbar-track {
background-color: transparent;
}
&::-webkit-scrollbar {
width: var(--scrollbarWidth);
}
// firefox
& {
scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg);
scrollbar-width: thin;
}
&::-moz-scrollbar-thumb {
background-color: var(--scrollbarThumbBg);
border-radius: calc(var(--scrollbarWidth) / 2);
border: calc(var(--scrollbarWidth) / 4) solid var(--secondary);
}
&::-moz-scrollbar-track {
background-color: transparent;
}
&::-moz-scrollbar {
width: var(--scrollbarWidth);
}
}
.chat-message-text {
pre {
scrollbar-color: var(--primary-300) transparent;
}
}