It takes a set of parameters and generates a singletone object class.
The object class terminology comes from cssguidelin.es
npm i -S scss-mixin-object-scroller
- Import it into your SCSS code:
@import "~scss-mixin-object-scroller";
- $size:
(unit) default: 6px
- $bg:
(color) default: #eee
- $fg.
(color) default: #333
- $radius.
(unit) default: $size
-
Use it once to generate your singletone scroller object:
@include scroller();
It will generate:
.scroller { overflow: auto; } .scroller::-webkit-scrollbar { width: 6px; height: 6px; } .scroller::-webkit-scrollbar-track-piece { background-color: #eee; } .scroller::-webkit-scrollbar-thumb:horizontal, .scroller::-webkit-scrollbar-thumb:vertical { border-radius: 6px; background-color: #333; }