-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
setupjss.js
41 lines (36 loc) · 967 Bytes
/
setupjss.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { create } from 'jss';
import global from 'jss-global';
import isolate from 'jss-isolate';
import nested from 'jss-nested';
import camelCase from 'jss-camel-case';
import defaultUnit from 'jss-default-unit';
import compose from 'jss-compose';
import nonInheritedProps from './nonInheritedProps';
const createGenerateClassName = () => {
let counter = 0;
return rule => `rsg--${rule.key}-${counter++}`;
};
const jss = create({
createGenerateClassName,
plugins: [
global(),
isolate({
reset: {
// Reset all inherited and non-inherited properties
...nonInheritedProps,
// “Global” styles for all components
boxSizing: 'border-box',
// Allow inheritance because it may be set on body and should be available for user components
color: 'inherit',
fontFamily: 'inherit',
lineHeight: 'inherit',
fontSize: 'inherit',
},
}),
nested(),
camelCase(),
defaultUnit(),
compose(),
],
});
export default jss;