@flodesk/grain 6.14.0 → 6.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button.js +10 -9
- package/es/components/checkbox.js +3 -3
- package/es/components/switch.js +3 -3
- package/es/components/tooltip.js +2 -2
- package/es/foundational/menu.js +2 -2
- package/es/foundational/styles.js +15 -15
- package/es/styles/base.css +3 -3
- package/es/styles/colors/core.css +72 -0
- package/es/styles/colors/{shades.css → theme.css} +37 -53
- package/es/styles/shadows.css +74 -0
- package/es/styles/variables.css +0 -27
- package/es/utilities/responsive.js +2 -2
- package/es/variables/colors.js +6 -10
- package/es/variables/vars.js +3 -3
- package/package.json +1 -1
- package/es/styles/colors/bases.css +0 -13
- package/es/styles/colors/semantics.css +0 -51
|
@@ -1,57 +1,6 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--grn-color-shadeTone13: hsl(0 0% 5%);
|
|
3
|
-
--grn-color-shadeTone12: hsl(0 0% 7%);
|
|
4
|
-
--grn-color-shadeTone11: hsl(0 0% 11%);
|
|
5
|
-
--grn-color-shadeTone10: hsl(0 0% 16%);
|
|
6
|
-
--grn-color-shadeTone9: hsl(0 0% 24%);
|
|
7
|
-
--grn-color-shadeTone8: hsl(0 0% 35%);
|
|
8
|
-
--grn-color-shadeTone7: hsl(0 0% 50%);
|
|
9
|
-
--grn-color-shadeTone6: hsl(0 0% 69%);
|
|
10
|
-
--grn-color-shadeTone5: hsl(0 0% 82%);
|
|
11
|
-
--grn-color-shadeTone4: hsl(0 0% 90%);
|
|
12
|
-
--grn-color-shadeTone3: hsl(0 0% 95%);
|
|
13
|
-
--grn-color-shadeTone2: hsl(0 0% 98%);
|
|
14
|
-
--grn-color-shadeTone1: hsl(0 0% 100%);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:root {
|
|
18
|
-
--fadeA10: 70%;
|
|
19
|
-
--fadeA9: 63%;
|
|
20
|
-
--fadeA8: 56%;
|
|
21
|
-
--fadeA7: 49%;
|
|
22
|
-
--fadeA6: 42%;
|
|
23
|
-
--fadeA5: 35%;
|
|
24
|
-
--fadeA4: 28%;
|
|
25
|
-
--fadeA3: 21%;
|
|
26
|
-
--fadeA2: 14%;
|
|
27
|
-
--fadeA1: 7%;
|
|
28
|
-
|
|
29
|
-
--grn-color-whiteFade10: hsl(0 0% 100% / var(--fadeA10));
|
|
30
|
-
--grn-color-whiteFade9: hsl(0 0% 100% / var(--fadeA9));
|
|
31
|
-
--grn-color-whiteFade8: hsl(0 0% 100% / var(--fadeA8));
|
|
32
|
-
--grn-color-whiteFade7: hsl(0 0% 100% / var(--fadeA7));
|
|
33
|
-
--grn-color-whiteFade6: hsl(0 0% 100% / var(--fadeA6));
|
|
34
|
-
--grn-color-whiteFade5: hsl(0 0% 100% / var(--fadeA5));
|
|
35
|
-
--grn-color-whiteFade4: hsl(0 0% 100% / var(--fadeA4));
|
|
36
|
-
--grn-color-whiteFade3: hsl(0 0% 100% / var(--fadeA3));
|
|
37
|
-
--grn-color-whiteFade2: hsl(0 0% 100% / var(--fadeA2));
|
|
38
|
-
--grn-color-whiteFade1: hsl(0 0% 100% / var(--fadeA1));
|
|
39
|
-
|
|
40
|
-
--grn-color-blackFade10: hsl(0 0% 0% / var(--fadeA10));
|
|
41
|
-
--grn-color-blackFade9: hsl(0 0% 0% / var(--fadeA9));
|
|
42
|
-
--grn-color-blackFade8: hsl(0 0% 0% / var(--fadeA8));
|
|
43
|
-
--grn-color-blackFade7: hsl(0 0% 0% / var(--fadeA7));
|
|
44
|
-
--grn-color-blackFade6: hsl(0 0% 0% / var(--fadeA6));
|
|
45
|
-
--grn-color-blackFade5: hsl(0 0% 0% / var(--fadeA5));
|
|
46
|
-
--grn-color-blackFade4: hsl(0 0% 0% / var(--fadeA4));
|
|
47
|
-
--grn-color-blackFade3: hsl(0 0% 0% / var(--fadeA3));
|
|
48
|
-
--grn-color-blackFade2: hsl(0 0% 0% / var(--fadeA2));
|
|
49
|
-
--grn-color-blackFade1: hsl(0 0% 0% / var(--fadeA1));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
1
|
/* light */
|
|
53
2
|
|
|
54
|
-
:root, [data-theme="light"] {
|
|
3
|
+
:root, [data-theme="light"], [data-theme="dark"] [data-theme="invert"] {
|
|
55
4
|
--grn-color-fade10: var(--grn-color-blackFade10);
|
|
56
5
|
--grn-color-fade9: var(--grn-color-blackFade9);
|
|
57
6
|
--grn-color-fade8: var(--grn-color-blackFade8);
|
|
@@ -80,7 +29,7 @@
|
|
|
80
29
|
|
|
81
30
|
/* dark */
|
|
82
31
|
|
|
83
|
-
[data-theme="dark"] {
|
|
32
|
+
[data-theme="dark"], [data-theme="light"] [data-theme="invert"] {
|
|
84
33
|
--grn-color-fade10: var(--grn-color-whiteFade10);
|
|
85
34
|
--grn-color-fade9: var(--grn-color-whiteFade9);
|
|
86
35
|
--grn-color-fade8: var(--grn-color-whiteFade8);
|
|
@@ -106,3 +55,38 @@
|
|
|
106
55
|
--grn-color-shade12: var(--grn-color-shadeTone2);
|
|
107
56
|
--grn-color-shade13: var(--grn-color-shadeTone1);
|
|
108
57
|
}
|
|
58
|
+
|
|
59
|
+
/* light */
|
|
60
|
+
|
|
61
|
+
:root, [data-theme="light"], [data-theme="dark"] [data-theme="invert"] {
|
|
62
|
+
--contentL: 0%;
|
|
63
|
+
--backgroundL: 100%;
|
|
64
|
+
--grn-color-floatingBackground: var(--grn-color-shade1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* dark */
|
|
68
|
+
|
|
69
|
+
[data-theme="dark"], [data-theme="light"] [data-theme="invert"] {
|
|
70
|
+
--contentL: 100%;
|
|
71
|
+
--backgroundL: 0%;
|
|
72
|
+
--grn-color-floatingBackground: var(--grn-color-shade2);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* light + dark */
|
|
76
|
+
|
|
77
|
+
:root, [data-theme] {
|
|
78
|
+
--grn-color-content: var(--grn-color-shade12);
|
|
79
|
+
--grn-color-content2: var(--grn-color-fade7);
|
|
80
|
+
--grn-color-content3: var(--grn-color-fade5);
|
|
81
|
+
--grn-color-disabledContent: var(--grn-color-shade7);
|
|
82
|
+
--grn-color-icon: var(--grn-color-fade6);
|
|
83
|
+
|
|
84
|
+
--grn-color-background: var(--grn-color-shade1);
|
|
85
|
+
--grn-color-background2: var(--grn-color-shade2);
|
|
86
|
+
--grn-color-background3: var(--grn-color-shade3);
|
|
87
|
+
--grn-color-disabledBackground: var(--grn-color-shade4);
|
|
88
|
+
|
|
89
|
+
--grn-color-border: hsl(var(--HS) var(--contentL) / 10%);
|
|
90
|
+
--grn-color-border2: hsl(var(--HS) var(--contentL) / 16%);
|
|
91
|
+
}
|
|
92
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
:root, [data-theme="light"], [data-theme="dark"] [data-theme="invert"] {
|
|
2
|
+
--alphaRatio: 0.75;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
[data-theme="dark"], [data-theme="light"] [data-theme="invert"] {
|
|
6
|
+
--alphaRatio: 20;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:root, [data-theme] {
|
|
10
|
+
--c: 0 0% 0%;
|
|
11
|
+
--blurRatio: 1.8;
|
|
12
|
+
--yRatio: 1.05;
|
|
13
|
+
--spreadRatio: 1.1;
|
|
14
|
+
--ratioCurve: 0.47;
|
|
15
|
+
|
|
16
|
+
--rc1: var(--ratioCurve) * 1;
|
|
17
|
+
--rc2: var(--ratioCurve) * 2;
|
|
18
|
+
--rc3: var(--ratioCurve) * 3;
|
|
19
|
+
--rc4: var(--ratioCurve) * 4;
|
|
20
|
+
--rc5: var(--ratioCurve) * 5;
|
|
21
|
+
--rc6: var(--ratioCurve) * 6;
|
|
22
|
+
|
|
23
|
+
--b1: 1px;
|
|
24
|
+
--b2: calc(var(--b1) * var(--rc2) * var(--blurRatio));
|
|
25
|
+
--b3: calc(var(--b2) * var(--rc3) * var(--blurRatio));
|
|
26
|
+
--b4: calc(var(--b3) * var(--rc4) * var(--blurRatio));
|
|
27
|
+
--b5: calc(var(--b4) * var(--rc5) * var(--blurRatio));
|
|
28
|
+
--b6: calc(var(--b5) * var(--rc6) * var(--blurRatio));
|
|
29
|
+
|
|
30
|
+
--y1: 1px;
|
|
31
|
+
--y2: calc(var(--y1) * var(--rc2) * var(--yRatio));
|
|
32
|
+
--y3: calc(var(--y2) * var(--rc3) * var(--yRatio));
|
|
33
|
+
--y4: calc(var(--y3) * var(--rc4) * var(--yRatio));
|
|
34
|
+
--y5: calc(var(--y4) * var(--rc5) * var(--yRatio));
|
|
35
|
+
--y6: calc(var(--y5) * var(--rc6) * var(--yRatio));
|
|
36
|
+
|
|
37
|
+
--a1: 3%;
|
|
38
|
+
--a2: calc(var(--a1) * var(--rc2) * var(--alphaRatio));
|
|
39
|
+
--a3: calc(var(--a2) * var(--rc3) * var(--alphaRatio));
|
|
40
|
+
--a4: calc(var(--a3) * var(--rc4) * var(--alphaRatio));
|
|
41
|
+
--a5: calc(var(--a4) * var(--rc5) * var(--alphaRatio));
|
|
42
|
+
--a6: calc(var(--a5) * var(--rc6) * var(--alphaRatio));
|
|
43
|
+
|
|
44
|
+
--s1: -0.1px;
|
|
45
|
+
--s2: calc(var(--s1) * var(--rc2) * var(--spreadRatio));
|
|
46
|
+
--s3: calc(var(--s2) * var(--rc3) * var(--spreadRatio));
|
|
47
|
+
--s4: calc(var(--s3) * var(--rc4) * var(--spreadRatio));
|
|
48
|
+
--s5: calc(var(--s4) * var(--rc5) * var(--spreadRatio));
|
|
49
|
+
--s6: calc(var(--s5) * var(--rc6) * var(--spreadRatio));
|
|
50
|
+
|
|
51
|
+
--shadow1: 0 var(--y1) var(--b1) var(--s1) hsl(var(--c) / var(--a1));
|
|
52
|
+
--shadow2: 0 var(--y2) var(--b2) var(--s2) hsl(var(--c) / var(--a2));
|
|
53
|
+
--shadow3: 0 var(--y3) var(--b3) var(--s3) hsl(var(--c) / var(--a3));
|
|
54
|
+
--shadow4: 0 var(--y4) var(--b4) var(--s4) hsl(var(--c) / var(--a4));
|
|
55
|
+
--shadow5: 0 var(--y5) var(--b5) var(--s5) hsl(var(--c) / var(--a5));
|
|
56
|
+
--shadow6: 0 var(--y6) var(--b6) var(--s6) hsl(var(--c) / var(--a6));
|
|
57
|
+
|
|
58
|
+
--grn-shadow-s:
|
|
59
|
+
var(--shadow1),
|
|
60
|
+
var(--shadow2),
|
|
61
|
+
var(--shadow3),
|
|
62
|
+
var(--shadow4)
|
|
63
|
+
;
|
|
64
|
+
|
|
65
|
+
--grn-shadow-m:
|
|
66
|
+
var(--grn-shadow-s),
|
|
67
|
+
var(--shadow5)
|
|
68
|
+
;
|
|
69
|
+
|
|
70
|
+
--grn-shadow-l:
|
|
71
|
+
var(--grn-shadow-m),
|
|
72
|
+
var(--shadow6)
|
|
73
|
+
;
|
|
74
|
+
}
|
package/es/styles/variables.css
CHANGED
|
@@ -47,33 +47,6 @@
|
|
|
47
47
|
--grn-transition-xxFast: 80ms;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/* shadow opacity ratio */
|
|
51
|
-
:root { --sor: 1 }
|
|
52
|
-
[data-theme="dark"] { --sor: 20 }
|
|
53
|
-
|
|
54
|
-
:root, [data-theme="dark"] {
|
|
55
|
-
--HSL: 0 0% 0%;
|
|
56
|
-
|
|
57
|
-
--grn-shadow-s:
|
|
58
|
-
0 0px 2px hsl(var(--HSL) / calc(5% * var(--sor))),
|
|
59
|
-
0 1px 4px hsl(var(--HSL) / calc(3% * var(--sor))),
|
|
60
|
-
0 2px 8px hsl(var(--HSL) / calc(2% * var(--sor))),
|
|
61
|
-
0 4px 16px hsl(var(--HSL) / calc(2% * var(--sor)))
|
|
62
|
-
;
|
|
63
|
-
|
|
64
|
-
--grn-shadow-m:
|
|
65
|
-
var(--grn-shadow-s),
|
|
66
|
-
0 8px 32px hsl(var(--HSL) / calc(4% * var(--sor)))
|
|
67
|
-
;
|
|
68
|
-
|
|
69
|
-
--grn-shadow-l:
|
|
70
|
-
var(--grn-shadow-m),
|
|
71
|
-
0 16px 64px hsl(var(--HSL) / calc(4% * var(--sor))),
|
|
72
|
-
0 32px 128px hsl(var(--HSL) / calc(5% * var(--sor))),
|
|
73
|
-
0 64px 128px -32px hsl(var(--HSL) / calc(5% * var(--sor)))
|
|
74
|
-
;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
50
|
:root {
|
|
78
51
|
--grn-space-betweenFormTitleAndContent: var(--grn-space-l);
|
|
79
52
|
--grn-space-betweenFormContents: var(--grn-space-m);
|
|
@@ -62,8 +62,8 @@ export var getDimension = function getDimension(dimension) {
|
|
|
62
62
|
if (isNumber(dimension)) return u(dimension);
|
|
63
63
|
};
|
|
64
64
|
export var getSpace = function getSpace(space) {
|
|
65
|
-
if (space in vars.
|
|
66
|
-
return getCssVar(varInfo.
|
|
65
|
+
if (space in vars.spaceUtils) {
|
|
66
|
+
return getCssVar(varInfo.spaceUtils.name, space);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
if (space in vars.spaces) {
|
package/es/variables/colors.js
CHANGED
|
@@ -71,14 +71,6 @@ export var colors = {
|
|
|
71
71
|
yellow: 'yellow',
|
|
72
72
|
green: 'green'
|
|
73
73
|
},
|
|
74
|
-
internals: {
|
|
75
|
-
contentDisabled: 'contentDisabled',
|
|
76
|
-
backgroundDisabled: 'backgroundDisabled',
|
|
77
|
-
icon: 'icon',
|
|
78
|
-
iconInvert: 'iconInvert',
|
|
79
|
-
contentInvert: 'contentInvert',
|
|
80
|
-
floatingBackground: 'floatingBackground'
|
|
81
|
-
},
|
|
82
74
|
generics: {
|
|
83
75
|
warning: 'warning',
|
|
84
76
|
danger: 'danger',
|
|
@@ -88,12 +80,16 @@ export var colors = {
|
|
|
88
80
|
contents: {
|
|
89
81
|
content: 'content',
|
|
90
82
|
content2: 'content2',
|
|
91
|
-
content3: 'content3'
|
|
83
|
+
content3: 'content3',
|
|
84
|
+
disabledContent: 'disabledContent',
|
|
85
|
+
icon: 'icon'
|
|
92
86
|
},
|
|
93
87
|
backgrounds: {
|
|
94
88
|
background: 'background',
|
|
95
89
|
background2: 'background2',
|
|
96
|
-
background3: 'background3'
|
|
90
|
+
background3: 'background3',
|
|
91
|
+
disabledBackground: 'disabledBackground',
|
|
92
|
+
floatingBackground: 'floatingBackground'
|
|
97
93
|
},
|
|
98
94
|
borders: {
|
|
99
95
|
border: 'border',
|
package/es/variables/vars.js
CHANGED
|
@@ -61,7 +61,7 @@ export var vars = {
|
|
|
61
61
|
xxFast: 'xxFast'
|
|
62
62
|
},
|
|
63
63
|
colors: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, colors.shadeTones), colors.shades), colors.fades), colors.blackFades), colors.whiteFades), colors.bases), colors.internals), colors.generics), colors.contents), colors.backgrounds), colors.borders),
|
|
64
|
-
|
|
64
|
+
spaceUtils: {
|
|
65
65
|
betweenFormTitleAndContent: 'betweenFormTitleAndContent',
|
|
66
66
|
betweenFormContents: 'betweenFormContents',
|
|
67
67
|
betweenFormContentAndActions: 'betweenFormContentAndActions',
|
|
@@ -101,8 +101,8 @@ export var varInfo = {
|
|
|
101
101
|
name: 'colors',
|
|
102
102
|
prefix: 'color'
|
|
103
103
|
},
|
|
104
|
-
|
|
105
|
-
name: '
|
|
104
|
+
spaceUtils: {
|
|
105
|
+
name: 'spaceUtils',
|
|
106
106
|
prefix: 'space'
|
|
107
107
|
}
|
|
108
108
|
};
|
package/package.json
CHANGED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--grn-color-warning: var(--grn-color-yellow);
|
|
3
|
-
--grn-color-danger: var(--grn-color-red);
|
|
4
|
-
--grn-color-success: var(--grn-color-green);
|
|
5
|
-
--grn-color-selection: var(--grn-color-blue);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/* light */
|
|
9
|
-
|
|
10
|
-
:root, [data-theme="light"] {
|
|
11
|
-
--borderL: 0%;
|
|
12
|
-
--iconInvertL: 100%;
|
|
13
|
-
--iconInvertA: 70%;
|
|
14
|
-
--dangerButtonBackgroundHoverL: 68%;
|
|
15
|
-
--dangerButtonBackgroundActiveL: 70%;
|
|
16
|
-
--grn-color-floatingBackground: var(--grn-color-shade1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* dark */
|
|
20
|
-
|
|
21
|
-
[data-theme="dark"] {
|
|
22
|
-
--borderL: 100%;
|
|
23
|
-
--iconInvertL: 0%;
|
|
24
|
-
--iconInvertA: 40%;
|
|
25
|
-
--dangerButtonBackgroundHoverL: 62%;
|
|
26
|
-
--dangerButtonBackgroundActiveL: 58%;
|
|
27
|
-
--grn-color-floatingBackground: var(--grn-color-shade2);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* light + dark */
|
|
31
|
-
|
|
32
|
-
:root, [data-theme] {
|
|
33
|
-
--grn-color-content: var(--grn-color-shade12);
|
|
34
|
-
--grn-color-content2: var(--grn-color-fade7);
|
|
35
|
-
--grn-color-content3: var(--grn-color-fade5);
|
|
36
|
-
|
|
37
|
-
--grn-color-background: var(--grn-color-shade1);
|
|
38
|
-
--grn-color-background2: var(--grn-color-shade2);
|
|
39
|
-
--grn-color-background3: var(--grn-color-shade3);
|
|
40
|
-
|
|
41
|
-
--grn-color-border: hsl(var(--HS) var(--borderL) / 10%);
|
|
42
|
-
--grn-color-border2: hsl(var(--HS) var(--borderL) / 16%);
|
|
43
|
-
|
|
44
|
-
--grn-color-contentDisabled: var(--grn-color-shade7);
|
|
45
|
-
--grn-color-backgroundDisabled: var(--grn-color-shade4);
|
|
46
|
-
|
|
47
|
-
--grn-color-icon: var(--grn-color-fade6);
|
|
48
|
-
--grn-color-iconInvert: hsl(var(--HS) var(--iconInvertL) / var(--iconInvertA));
|
|
49
|
-
|
|
50
|
-
--grn-color-contentInvert: var(--grn-color-shade2);
|
|
51
|
-
}
|