@gem-sdk/styles 1.36.1 → 1.36.8
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/package.json +1 -1
- package/src/plugins/size.js +12 -11
- package/src/plugins/typography.js +20 -7
package/package.json
CHANGED
package/src/plugins/size.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
const plugin = require('tailwindcss/plugin');
|
|
2
2
|
|
|
3
|
-
const size = plugin(function ({ addComponents }) {
|
|
3
|
+
const size = plugin(function ({ addComponents, config }) {
|
|
4
|
+
const isImportant = config('important') === true;
|
|
4
5
|
addComponents({
|
|
5
6
|
'.g-s-small': {
|
|
6
|
-
padding:
|
|
7
|
+
padding: `4px 16px ${isImportant ? '!important' : ''}`,
|
|
7
8
|
},
|
|
8
9
|
'.g-s-medium': {
|
|
9
|
-
padding:
|
|
10
|
+
padding: `8px 24px ${isImportant ? '!important' : ''}`,
|
|
10
11
|
},
|
|
11
12
|
'.g-s-large': {
|
|
12
|
-
padding:
|
|
13
|
+
padding: `12px 32px ${isImportant ? '!important' : ''}`,
|
|
13
14
|
},
|
|
14
15
|
'.g-s-tag-small': {
|
|
15
|
-
padding:
|
|
16
|
+
padding: `2px 8px ${isImportant ? '!important' : ''}`,
|
|
16
17
|
},
|
|
17
18
|
'.g-s-tag-medium': {
|
|
18
|
-
padding:
|
|
19
|
+
padding: `4px 12px ${isImportant ? '!important' : ''}`,
|
|
19
20
|
},
|
|
20
21
|
'.g-s-tag-large': {
|
|
21
|
-
padding:
|
|
22
|
+
padding: `8px 16px ${isImportant ? '!important' : ''}`,
|
|
22
23
|
},
|
|
23
24
|
'.g-s-none': {
|
|
24
|
-
padding:
|
|
25
|
+
padding: `0 ${isImportant ? '!important' : ''}`,
|
|
25
26
|
},
|
|
26
27
|
|
|
27
28
|
'.g-s-icon-small': {
|
|
28
|
-
padding:
|
|
29
|
+
padding: `8px 8px ${isImportant ? '!important' : ''}`,
|
|
29
30
|
},
|
|
30
31
|
'.g-s-icon-medium': {
|
|
31
|
-
padding:
|
|
32
|
+
padding: `16px 16px ${isImportant ? '!important' : ''}`,
|
|
32
33
|
},
|
|
33
34
|
'.g-s-icon-large': {
|
|
34
|
-
padding:
|
|
35
|
+
padding: `24px 24px ${isImportant ? '!important' : ''}`,
|
|
35
36
|
},
|
|
36
37
|
});
|
|
37
38
|
});
|
|
@@ -61,17 +61,30 @@ function getShortName(name) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
const typographyPlugin = plugin(
|
|
64
|
-
function ({ theme, addComponents }) {
|
|
64
|
+
function ({ theme, addComponents, config }) {
|
|
65
|
+
const isImportant = config('important') === true;
|
|
65
66
|
const typos = theme('typography').reduce((acc, name) => {
|
|
66
67
|
return {
|
|
67
68
|
...acc,
|
|
68
69
|
[`.g-${name}`]: {
|
|
69
|
-
fontSize: `var(--g-${getShortName(`typography-${name}-fontSize`)})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
fontSize: `var(--g-${getShortName(`typography-${name}-fontSize`)}) ${
|
|
71
|
+
isImportant ? '!important' : ''
|
|
72
|
+
}`,
|
|
73
|
+
fontFamily: `var(--g-${getShortName(`typography-${name}-fontFamily`)}) ${
|
|
74
|
+
isImportant ? '!important' : ''
|
|
75
|
+
}`,
|
|
76
|
+
fontWeight: `var(--g-${getShortName(`typography-${name}-fontWeight`)}) ${
|
|
77
|
+
isImportant ? '!important' : ''
|
|
78
|
+
}`,
|
|
79
|
+
fontStyle: `var(--g-${getShortName(`typography-${name}-fontStyle`)}) ${
|
|
80
|
+
isImportant ? '!important' : ''
|
|
81
|
+
}`,
|
|
82
|
+
lineHeight: `var(--g-${getShortName(`typography-${name}-lineHeight`)}) ${
|
|
83
|
+
isImportant ? '!important' : ''
|
|
84
|
+
}`,
|
|
85
|
+
letterSpacing: `var(--g-${getShortName(`typography-${name}-letterSpacing`)}) ${
|
|
86
|
+
isImportant ? '!important' : ''
|
|
87
|
+
}`,
|
|
75
88
|
},
|
|
76
89
|
};
|
|
77
90
|
}, {});
|