@keboola/tailwind-config 1.0.0 → 1.1.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/colors.ts +5 -1
- package/index.js +13 -32
- package/package.json +1 -1
- package/scrollFade.ts +8 -2
package/colors.ts
CHANGED
|
@@ -36,7 +36,7 @@ export default {
|
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
// Main application colors — channel values live in CSS variables (see packages/design/src/styles.css :root).
|
|
39
|
-
// The `<alpha-value>` placeholder lets Tailwind apply opacity modifiers like `tw
|
|
39
|
+
// The `<alpha-value>` placeholder lets Tailwind apply opacity modifiers like `tw:bg-muted/50`.
|
|
40
40
|
background: 'rgb(var(--color-background) / <alpha-value>)',
|
|
41
41
|
foreground: 'rgb(var(--color-foreground) / <alpha-value>)',
|
|
42
42
|
|
|
@@ -59,8 +59,12 @@ export default {
|
|
|
59
59
|
|
|
60
60
|
border: 'rgb(var(--color-border) / <alpha-value>)',
|
|
61
61
|
|
|
62
|
+
// `DEFAULT` is the input *border*; `background` is the control's own fill.
|
|
63
|
+
// Both are their own token because a form control is not a card — `card` is
|
|
64
|
+
// raised container chrome and re-skins independently of the field surface.
|
|
62
65
|
input: {
|
|
63
66
|
DEFAULT: 'rgb(var(--color-input) / <alpha-value>)',
|
|
67
|
+
background: 'rgb(var(--color-input-background) / <alpha-value>)',
|
|
64
68
|
},
|
|
65
69
|
|
|
66
70
|
// Focus ring (brand blue).
|
package/index.js
CHANGED
|
@@ -33,17 +33,16 @@ const config = {
|
|
|
33
33
|
},
|
|
34
34
|
animation: {
|
|
35
35
|
fade: 'fadeIn 100ms 100ms ease-in-out',
|
|
36
|
-
collapseDown: 'collapseDown 300ms both',
|
|
37
36
|
'dot-pulse-1': 'dot-pulse 1.5s infinite',
|
|
38
37
|
'dot-pulse-2': 'dot-pulse 1.5s infinite 0.2s',
|
|
39
38
|
'dot-pulse-3': 'dot-pulse 1.5s infinite 0.4s',
|
|
40
39
|
'toast-progress': 'toast-progress 5s linear forwards',
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// `collapsible-down` / `collapsible-up` are absent on purpose: `tw-animate-css` ships both
|
|
41
|
+
// utilities and wins, so an entry here emits nothing. `Collapsible`'s motion is registered
|
|
42
|
+
// as `collapsible-open` / `collapsible-close` in `packages/design/src/theme.css`.
|
|
43
43
|
'marching-ants': 'marching-ants 1s linear infinite',
|
|
44
44
|
'spinner-dots': 'spinner-dots 1s ease-in-out infinite',
|
|
45
45
|
'progress-bar': 'progress-bar var(--progress-bar-duration, 3s) linear forwards',
|
|
46
|
-
'caret-blink': 'caret-blink 1.25s ease-out infinite',
|
|
47
46
|
},
|
|
48
47
|
keyframes: {
|
|
49
48
|
// Animate the `translate` property, NOT `transform`. In v4 the `-translate-x-*`
|
|
@@ -57,11 +56,6 @@ const config = {
|
|
|
57
56
|
translate: '100% 0',
|
|
58
57
|
},
|
|
59
58
|
},
|
|
60
|
-
collapseDown: {
|
|
61
|
-
from: { overflow: 'hidden' },
|
|
62
|
-
'99%': { overflow: 'hidden' },
|
|
63
|
-
to: { overflow: 'visible' },
|
|
64
|
-
},
|
|
65
59
|
fadeIn: {
|
|
66
60
|
from: { opacity: 0 },
|
|
67
61
|
to: { opacity: 1 },
|
|
@@ -84,14 +78,6 @@ const config = {
|
|
|
84
78
|
width: '0%',
|
|
85
79
|
},
|
|
86
80
|
},
|
|
87
|
-
'collapsible-down': {
|
|
88
|
-
from: { height: '0', overflow: 'hidden' },
|
|
89
|
-
to: { height: 'var(--radix-collapsible-content-height)', overflow: 'visible' },
|
|
90
|
-
},
|
|
91
|
-
'collapsible-up': {
|
|
92
|
-
from: { height: 'var(--radix-collapsible-content-height)', overflow: 'visible' },
|
|
93
|
-
to: { height: '0', overflow: 'hidden' },
|
|
94
|
-
},
|
|
95
81
|
'marching-ants': {
|
|
96
82
|
to: { strokeDashoffset: '-12' },
|
|
97
83
|
},
|
|
@@ -104,14 +90,10 @@ const config = {
|
|
|
104
90
|
from: { width: '0%' },
|
|
105
91
|
to: { width: '100%' },
|
|
106
92
|
},
|
|
107
|
-
'caret-blink': {
|
|
108
|
-
'0%, 70%, 100%': { opacity: '1' },
|
|
109
|
-
'20%, 50%': { opacity: '0' },
|
|
110
|
-
},
|
|
111
93
|
},
|
|
112
94
|
backgroundImage: {
|
|
113
95
|
'loader-gradient': 'radial-gradient(circle closest-side,#000 90%,#0000)',
|
|
114
|
-
// Brand gradient — `tw
|
|
96
|
+
// Brand gradient — `tw:bg-brand`. Set via `theme.gradient.brand`; the
|
|
115
97
|
// inline fallback equals the stylesheet default (primary→accent), so the
|
|
116
98
|
// utility stays valid even without `@keboola/design/styles`.
|
|
117
99
|
brand:
|
|
@@ -125,22 +107,21 @@ const config = {
|
|
|
125
107
|
table: '0px 6px 6px -4px rgba(100, 135, 153, 0.13)',
|
|
126
108
|
card: '0px 1px 4px rgba(100, 135, 153, 0.15)',
|
|
127
109
|
// Brand-driven elevation. The inline fallbacks equal the stock Tailwind
|
|
128
|
-
// shadow scale, so `tw-shadow-
|
|
129
|
-
// `theme.shadows`. `tw
|
|
110
|
+
// shadow scale, so `tw:shadow-sm`, `tw:shadow-md` and `tw:shadow-lg`
|
|
111
|
+
// are unchanged until a brand sets `theme.shadows`. `tw:shadow-lift`
|
|
112
|
+
// is a stronger raised shadow.
|
|
130
113
|
sm: 'var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05))',
|
|
131
114
|
md: 'var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1))',
|
|
132
115
|
lg: 'var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1))',
|
|
133
116
|
lift: 'var(--shadow-lift, 0 10px 30px -12px rgb(0 0 0 / 0.28), 0 2px 6px rgb(0 0 0 / 0.06))',
|
|
134
|
-
// Raised-surface elevation for Card / Search — dark-aware via the
|
|
135
|
-
// `--shadow-raised` token (flips to a black shadow under `[data-theme=dark]`).
|
|
136
|
-
raised: 'var(--shadow-raised, 0 2px 6px 0 rgb(100 135 153 / 0.13))',
|
|
137
117
|
},
|
|
138
118
|
borderRadius: {
|
|
139
119
|
card: '10px',
|
|
140
120
|
// Brand-driven corner radii — a brand overrides via `theme.radii`, which
|
|
141
121
|
// `ThemeProvider` emits as `--radius-*`. The inline fallbacks equal the
|
|
142
|
-
// stock Tailwind scale, so `tw-rounded-
|
|
143
|
-
//
|
|
122
|
+
// stock Tailwind scale, so `tw:rounded-sm`, `tw:rounded-md` and
|
|
123
|
+
// `tw:rounded-lg` are unchanged until a brand (or the design
|
|
124
|
+
// stylesheet's `:root`) sets the var. Mirrors the
|
|
144
125
|
// `shadow-*` / `space-*` pattern above.
|
|
145
126
|
sm: 'var(--radius-sm, 0.125rem)',
|
|
146
127
|
md: 'var(--radius-md, 0.375rem)',
|
|
@@ -153,7 +134,7 @@ const config = {
|
|
|
153
134
|
brand: 'var(--motion-easing, cubic-bezier(0.2, 0.7, 0.2, 1))',
|
|
154
135
|
},
|
|
155
136
|
spacing: {
|
|
156
|
-
// Brand-driven density: `tw
|
|
137
|
+
// Brand-driven density: `tw:p-inset`, `tw:gap-gutter`, etc.
|
|
157
138
|
gutter: 'var(--space-gutter, 1.5rem)',
|
|
158
139
|
inset: 'var(--space-inset, 1.5rem)',
|
|
159
140
|
},
|
|
@@ -200,7 +181,7 @@ const config = {
|
|
|
200
181
|
},
|
|
201
182
|
},
|
|
202
183
|
fontFamily: {
|
|
203
|
-
// Display face for headings — `tw
|
|
184
|
+
// Display face for headings — `tw:font-display`. Set via
|
|
204
185
|
// `theme.typography.fontDisplay`; when unset it resolves to `--font-sans`
|
|
205
186
|
// then the Inter stack, so it defaults to the body face rather than a
|
|
206
187
|
// generic `sans-serif`. The fallback chain lives *inside* the `var()` so
|
|
@@ -233,7 +214,7 @@ const config = {
|
|
|
233
214
|
'Courier New',
|
|
234
215
|
'monospace',
|
|
235
216
|
],
|
|
236
|
-
// Body face — `tw
|
|
217
|
+
// Body face — `tw:font-sans`. A brand's `typography.fontFamily` is emitted
|
|
237
218
|
// as `--font-sans` by `ThemeProvider`; the inline `Inter` fallback keeps
|
|
238
219
|
// the canonical stack when unset, so default rendering is unchanged. The
|
|
239
220
|
// fallback lives *inside* the `var()` (same reasoning as `display` above)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keboola/tailwind-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Shared Tailwind CSS v4 design tokens for the Keboola UI platform — semantic color palette, type scale, radii and shadows as a `theme` object.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/scrollFade.ts
CHANGED
|
@@ -27,8 +27,14 @@ export const scrollFadePlugin = plugin(function ({ addUtilities, addBase }) {
|
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
// The leading edge takes its own size, defaulting to the shared one. A region that pins a
|
|
31
|
+
// `position: sticky` header at its top sets it shallow: the mask dims whatever it covers, header
|
|
32
|
+
// included, and only a mask actually dissolves content — a background-coloured overlay just tints
|
|
33
|
+
// it, which is invisible over a card barely lighter than the page.
|
|
34
|
+
const START_SIZE = 'var(--tw-scroll-fade-size-start, var(--tw-scroll-fade-size))';
|
|
35
|
+
|
|
30
36
|
const scrollFadeMask = (direction: 'bottom' | 'right') =>
|
|
31
|
-
`linear-gradient(to ${direction}, rgb(0 0 0 / var(--tw-scroll-fade-start)) 0, #000
|
|
37
|
+
`linear-gradient(to ${direction}, rgb(0 0 0 / var(--tw-scroll-fade-start)) 0, #000 ${START_SIZE}, #000 calc(100% - var(--tw-scroll-fade-size)), rgb(0 0 0 / var(--tw-scroll-fade-end)) 100%)`;
|
|
32
38
|
|
|
33
39
|
const scrollFade = (direction: 'bottom' | 'right', axis: 'x' | 'y') => ({
|
|
34
40
|
'--tw-scroll-fade-size': '1.5rem',
|
|
@@ -36,7 +42,7 @@ export const scrollFadePlugin = plugin(function ({ addUtilities, addBase }) {
|
|
|
36
42
|
maskImage: scrollFadeMask(direction),
|
|
37
43
|
animation: 'tw-scroll-fade-reveal-start linear both, tw-scroll-fade-reveal-end linear both',
|
|
38
44
|
animationTimeline: `scroll(self ${axis}), scroll(self ${axis})`,
|
|
39
|
-
animationRange:
|
|
45
|
+
animationRange: `0 ${START_SIZE}, calc(100% - var(--tw-scroll-fade-size)) 100%`,
|
|
40
46
|
// Browsers without scroll-driven animations show a static fade on both edges.
|
|
41
47
|
'@supports not (animation-timeline: scroll())': {
|
|
42
48
|
'--tw-scroll-fade-start': '0',
|