Skip to content

Commit

Permalink
fix(styles): handle firefox style without warning in chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRamstrom committed Apr 11, 2024
1 parent fac41da commit 8fa3ba3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions styles/src/static/static.styles.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { makeStaticStyles, tokens } from "@fluentui/react-components";

const scrollbarColor = tokens.colorScrollbarOverlay;

const isFirefox = window.navigator.userAgent.includes("Fire");
export const useScrollStaticStyles = makeStaticStyles({
"@-moz-document url-prefix() {*": {
"*": {
// Firefox
// Scrollbar styling is amazingly complex. Read more here:
// https://stackoverflow.com/questions/6165472/custom-css-scrollbar-for-firefox
scrollbarWidth: "thin",
scrollbarColor: `${scrollbarColor} transparent`,
scrollbarWidth: isFirefox ? "thin" : "unset",
scrollbarColor: isFirefox ? `${scrollbarColor} transparent` : "auto",
},
"*::-webkit-scrollbar": {
width: tokens.spacingHorizontalSNudge,
Expand Down

0 comments on commit 8fa3ba3

Please sign in to comment.