[fix] Add support for browsers that implement scrollbar-width

Close #1395
This commit is contained in:
Pawel Borkowski
2019-07-09 14:33:55 +02:00
committed by Nicolas Gallagher
parent a7ddd7b9ac
commit ef770d4bd1
2 changed files with 4 additions and 1 deletions
@@ -64,6 +64,7 @@ Object {
"rules": Array [
".r-scrollbarWidth-2eszeu::-webkit-scrollbar{display:none}",
".r-scrollbarWidth-2eszeu{overflow:-moz-scrollbars-none;-ms-overflow-style:none}",
".r-scrollbarWidth-2eszeu{scrollbar-width:none;}",
],
"value": "none",
},
@@ -148,9 +148,11 @@ function createAtomicRules(identifier: string, property, value): Rules {
// https://drafts.csswg.org/css-scrollbars-1/
case 'scrollbarWidth': {
if (value === 'none') {
const block = createDeclarationBlock({ [property]: value });
rules.push(
`${selector}::-webkit-scrollbar{display:none}`,
`${selector}{overflow:-moz-scrollbars-none;-ms-overflow-style:none}`
`${selector}{overflow:-moz-scrollbars-none;-ms-overflow-style:none}`,
`${selector}${block}`
);
}
break;