@keboola/tailwind-config 0.6.0 → 0.8.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/index.js +60 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -152,6 +152,14 @@ const baseConfig = {
|
|
|
152
152
|
},
|
|
153
153
|
borderRadius: {
|
|
154
154
|
card: '10px',
|
|
155
|
+
// Brand-driven corner radii — a brand overrides via `theme.radii`, which
|
|
156
|
+
// `ThemeProvider` emits as `--radius-*`. The inline fallbacks equal the
|
|
157
|
+
// stock Tailwind scale, so `tw-rounded-sm/md/lg` are unchanged until a
|
|
158
|
+
// brand (or the design stylesheet's `:root`) sets the var. Mirrors the
|
|
159
|
+
// `shadow-*` / `space-*` pattern above.
|
|
160
|
+
sm: 'var(--radius-sm, 0.125rem)',
|
|
161
|
+
md: 'var(--radius-md, 0.375rem)',
|
|
162
|
+
lg: 'var(--radius-lg, 0.5rem)',
|
|
155
163
|
},
|
|
156
164
|
transitionDuration: {
|
|
157
165
|
brand: 'var(--motion-duration, 200ms)',
|
|
@@ -166,6 +174,45 @@ const baseConfig = {
|
|
|
166
174
|
},
|
|
167
175
|
typography: typography,
|
|
168
176
|
colors,
|
|
177
|
+
// Brand-driven type scale — semantic `text-display` / `text-heading` /
|
|
178
|
+
// `text-body` utilities that bundle size + line-height + weight + tracking
|
|
179
|
+
// into one step. Each axis reads a `--type-*` var (emitted by ThemeProvider
|
|
180
|
+
// from `typography.typeScale`) with an inline fallback, so the utilities
|
|
181
|
+
// stay valid and unchanged until a brand opts in. Under `extend` so
|
|
182
|
+
// Tailwind's default `text-sm` / `text-xl` / … scale is preserved.
|
|
183
|
+
fontSize: {
|
|
184
|
+
display: [
|
|
185
|
+
'var(--type-display-size, 1.875rem)',
|
|
186
|
+
{
|
|
187
|
+
lineHeight: 'var(--type-display-leading, 1.2)',
|
|
188
|
+
fontWeight: 'var(--type-display-weight, 600)',
|
|
189
|
+
letterSpacing: 'var(--type-display-tracking, -0.02em)',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
heading: [
|
|
193
|
+
'var(--type-heading-size, 1.25rem)',
|
|
194
|
+
{
|
|
195
|
+
lineHeight: 'var(--type-heading-leading, 1.4)',
|
|
196
|
+
fontWeight: 'var(--type-heading-weight, 600)',
|
|
197
|
+
letterSpacing: 'var(--type-heading-tracking, -0.01em)',
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
body: [
|
|
201
|
+
'var(--type-body-size, 0.875rem)',
|
|
202
|
+
{
|
|
203
|
+
lineHeight: 'var(--type-body-leading, 1.5)',
|
|
204
|
+
fontWeight: 'var(--type-body-weight, 400)',
|
|
205
|
+
letterSpacing: 'var(--type-body-tracking, normal)',
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
// Chrome tracking token — under `extend` so Tailwind's default tracking
|
|
210
|
+
// scale (`tracking-normal` / `tracking-wide` / …) is preserved. `chrome`
|
|
211
|
+
// reads `--letter-spacing-chrome` (from `typography.letterSpacing.chrome`),
|
|
212
|
+
// falling back to the current 1px value.
|
|
213
|
+
letterSpacing: {
|
|
214
|
+
chrome: 'var(--letter-spacing-chrome, 1px)',
|
|
215
|
+
},
|
|
169
216
|
},
|
|
170
217
|
fontFamily: {
|
|
171
218
|
// Display face for headings — `tw-font-display`. Set via
|
|
@@ -201,8 +248,13 @@ const baseConfig = {
|
|
|
201
248
|
'Courier New',
|
|
202
249
|
'monospace',
|
|
203
250
|
],
|
|
251
|
+
// Body face — `tw-font-sans`. A brand's `typography.fontFamily` is emitted
|
|
252
|
+
// as `--font-sans` by `ThemeProvider`; the inline `Inter` fallback keeps
|
|
253
|
+
// the canonical stack when unset, so default rendering is unchanged. The
|
|
254
|
+
// fallback lives *inside* the `var()` (same reasoning as `display` above)
|
|
255
|
+
// so the declaration stays valid when the var is undefined.
|
|
204
256
|
sans: [
|
|
205
|
-
'Inter',
|
|
257
|
+
'var(--font-sans, Inter)',
|
|
206
258
|
'system-ui',
|
|
207
259
|
'-apple-system',
|
|
208
260
|
'Segoe UI',
|
|
@@ -218,11 +270,14 @@ const baseConfig = {
|
|
|
218
270
|
'Noto Color Emoji',
|
|
219
271
|
],
|
|
220
272
|
},
|
|
273
|
+
// Chrome font-weight scale. Brand-overridable via `--font-weight-*` (emitted
|
|
274
|
+
// by ThemeProvider from `typography.weight`); fallbacks are the design
|
|
275
|
+
// defaults, so a brand that omits weights shows no drift.
|
|
221
276
|
fontWeight: {
|
|
222
|
-
normal: '400',
|
|
223
|
-
medium: '500',
|
|
224
|
-
semibold: '600',
|
|
225
|
-
bold: '700',
|
|
277
|
+
normal: 'var(--font-weight-normal, 400)',
|
|
278
|
+
medium: 'var(--font-weight-medium, 500)',
|
|
279
|
+
semibold: 'var(--font-weight-semibold, 600)',
|
|
280
|
+
bold: 'var(--font-weight-bold, 700)',
|
|
226
281
|
},
|
|
227
282
|
},
|
|
228
283
|
plugins: [
|
package/package.json
CHANGED