@obosbbl/grunnmuren-tailwind 0.4.0 → 0.5.0
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 +3 -3
- package/tailwind-base.cjs +74 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-tailwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Grunnmuren Tailwind preset",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@tailwindcss/aspect-ratio": "0.4.0",
|
|
19
|
-
"@tailwindcss/typography": "0.5.
|
|
19
|
+
"@tailwindcss/typography": "0.5.4"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"tailwindcss": "3.
|
|
22
|
+
"tailwindcss": "3.1.8"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"tailwindcss": "^3"
|
package/tailwind-base.cjs
CHANGED
|
@@ -47,12 +47,30 @@ const obosFonts = [
|
|
|
47
47
|
},
|
|
48
48
|
];
|
|
49
49
|
|
|
50
|
-
const button = plugin(function ({ addComponents }) {
|
|
51
|
-
// adds a shade on the button when hovered
|
|
52
|
-
// ideally this would be solved by just darkening the button background,
|
|
53
|
-
// but that doesn't really work since some of the button variations have transparent backgrounds
|
|
50
|
+
const button = plugin(function ({ addComponents, theme }) {
|
|
54
51
|
addComponents({
|
|
55
52
|
'.button': {
|
|
53
|
+
// The Tailwind utilities we use for focus styling are kinda hard to "translate", so using the @apply utility here, even though mixing styles are meh...
|
|
54
|
+
'@apply focus:outline-none focus-visible:ring-2 focus-visible:ring-black ring-offset-2':
|
|
55
|
+
{},
|
|
56
|
+
position: 'relative',
|
|
57
|
+
textDecorationLine: 'none',
|
|
58
|
+
display: 'inline-block',
|
|
59
|
+
border: '2px solid',
|
|
60
|
+
padding: `${theme('spacing.2')} ${theme('spacing.6')}`,
|
|
61
|
+
borderRadius: '0.75rem',
|
|
62
|
+
transition: `all 200ms ${theme('transitionTimingFunction.DEFAULT')}`,
|
|
63
|
+
fontWeight: theme('fontWeight.medium'),
|
|
64
|
+
width: 'fit-content',
|
|
65
|
+
'&:disabled': {
|
|
66
|
+
backgroundColor: theme('colors.gray.light'),
|
|
67
|
+
borderColor: theme('colors.gray.light'),
|
|
68
|
+
color: theme('colors.black'),
|
|
69
|
+
pointerEvents: 'none',
|
|
70
|
+
},
|
|
71
|
+
'&:hover': {
|
|
72
|
+
borderRadius: '0.375rem',
|
|
73
|
+
},
|
|
56
74
|
'&::after': {
|
|
57
75
|
content: '""',
|
|
58
76
|
position: 'absolute',
|
|
@@ -64,16 +82,61 @@ const button = plugin(function ({ addComponents }) {
|
|
|
64
82
|
bottom: '-2px',
|
|
65
83
|
borderRadius: '0.75rem',
|
|
66
84
|
},
|
|
85
|
+
// adds a shade on the button when hovered
|
|
86
|
+
// ideally this would be solved by just darkening the button background,
|
|
87
|
+
// but that doesn't really work since some of the button variations have transparent backgrounds
|
|
67
88
|
'&:hover::after': {
|
|
68
89
|
backgroundColor: 'rgba(0, 0, 0, 0.1)',
|
|
69
90
|
borderRadius: '0.375rem',
|
|
70
|
-
transition:
|
|
91
|
+
transition: `all 200ms ${theme('transitionTimingFunction.DEFAULT')}`,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const radio = plugin(function ({ addComponents, theme }) {
|
|
98
|
+
addComponents({
|
|
99
|
+
'.radio': {
|
|
100
|
+
// hide the native radio input
|
|
101
|
+
appearance: 'none',
|
|
102
|
+
// not removed via appeareance
|
|
103
|
+
margin: 0,
|
|
104
|
+
height: '1.25rem',
|
|
105
|
+
width: '1.25rem',
|
|
106
|
+
borderRadius: '50%',
|
|
107
|
+
border: `2px solid ${theme('colors.gray.dark')}`,
|
|
108
|
+
cursor: 'pointer',
|
|
109
|
+
marginRight: '0.75rem',
|
|
110
|
+
// use grid to handle the checked:before styles
|
|
111
|
+
display: 'inline-grid',
|
|
112
|
+
placeContent: 'center',
|
|
113
|
+
'&:checked': {
|
|
114
|
+
borderColor: theme('colors.green.DEFAULT'),
|
|
115
|
+
},
|
|
116
|
+
'&:focus-visible': {
|
|
117
|
+
outline: '1px solid currentColor',
|
|
118
|
+
outlineOffset: '4px',
|
|
119
|
+
},
|
|
120
|
+
'&::before': {
|
|
121
|
+
content: '""',
|
|
122
|
+
display: 'block',
|
|
123
|
+
borderRadius: '50%',
|
|
124
|
+
transform: 'scale(0)',
|
|
125
|
+
width: '0.65em',
|
|
126
|
+
height: '0.65em',
|
|
127
|
+
transition: '120ms transform ease-in-out',
|
|
128
|
+
boxShadow: `inset 1em 1em ${theme('colors.green.DEFAULT')}`,
|
|
129
|
+
/* Windows High Contrast Mode */
|
|
130
|
+
backgroundColor: 'CanvasText',
|
|
131
|
+
},
|
|
132
|
+
'&:checked::before': {
|
|
133
|
+
transform: 'scale(1)',
|
|
71
134
|
},
|
|
72
135
|
},
|
|
73
136
|
});
|
|
74
137
|
});
|
|
75
138
|
|
|
76
|
-
const checkbox = plugin(function ({ addComponents }) {
|
|
139
|
+
const checkbox = plugin(function ({ addComponents, theme }) {
|
|
77
140
|
addComponents({
|
|
78
141
|
'.checkbox': {
|
|
79
142
|
'&::before': {
|
|
@@ -82,6 +145,7 @@ const checkbox = plugin(function ({ addComponents }) {
|
|
|
82
145
|
height: '0.65em',
|
|
83
146
|
transform: 'scale(0)',
|
|
84
147
|
transition: '120ms transform ease-in-out',
|
|
148
|
+
backgroundColor: theme('colors.white'),
|
|
85
149
|
'box-shadow': 'inset 1em 1em currentColor',
|
|
86
150
|
'clip-path':
|
|
87
151
|
'polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)',
|
|
@@ -167,14 +231,14 @@ module.exports = (userOptions) => {
|
|
|
167
231
|
const opts = userOptions ? { ...defaultOpts, ...userOptions } : defaultOpts;
|
|
168
232
|
let fontFamily = 'OBOSFont';
|
|
169
233
|
let fonts = obosFonts;
|
|
170
|
-
let containerSize = '
|
|
234
|
+
let containerSize = '92rem';
|
|
171
235
|
if (opts.useLegacyFont) {
|
|
172
236
|
fontFamily = 'Gordita';
|
|
173
237
|
fonts = gorditaFonts;
|
|
174
238
|
}
|
|
175
239
|
|
|
176
240
|
if (opts.useLegacyContainerSize) {
|
|
177
|
-
containerSize = '
|
|
241
|
+
containerSize = '82rem';
|
|
178
242
|
}
|
|
179
243
|
|
|
180
244
|
return {
|
|
@@ -186,6 +250,7 @@ module.exports = (userOptions) => {
|
|
|
186
250
|
headings,
|
|
187
251
|
checkbox,
|
|
188
252
|
snackbar,
|
|
253
|
+
radio,
|
|
189
254
|
plugin(function ({ addBase, addUtilities, addComponents, theme }) {
|
|
190
255
|
addBase({
|
|
191
256
|
html: {
|
|
@@ -221,7 +286,7 @@ module.exports = (userOptions) => {
|
|
|
221
286
|
paddingRight: '1rem',
|
|
222
287
|
marginLeft: 'auto',
|
|
223
288
|
marginRight: 'auto',
|
|
224
|
-
maxWidth: '
|
|
289
|
+
maxWidth: '39rem',
|
|
225
290
|
},
|
|
226
291
|
// that thin blue line at the top
|
|
227
292
|
'.topline::before': {
|