@classic-homes/theme-tailwind-preset 0.4.2 → 0.7.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/README.md +34 -0
- package/index.js +5 -2
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @classic-homes/theme-tailwind-preset
|
|
2
|
+
|
|
3
|
+
Tailwind CSS preset for the Classic Theme system. It configures Tailwind with the Classic Homes design tokens and enables class-based dark mode.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @classic-homes/theme-tailwind-preset tailwindcss
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `tailwindcss@>=3.0.0`. The preset also depends on `@classic-homes/theme-tokens`.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
// tailwind.config.js
|
|
17
|
+
import preset from '@classic-homes/theme-tailwind-preset';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
presets: [preset],
|
|
21
|
+
content: [
|
|
22
|
+
'./src/**/*.{html,js,svelte,ts,tsx}',
|
|
23
|
+
'./node_modules/@classic-homes/theme-svelte/**/*.{html,js,svelte,ts}',
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Semantic colors use the HSL CSS variables from `@classic-homes/theme-styles`, for example `bg-primary`, `text-foreground`, `border-border`, and `bg-brand-*`.
|
|
29
|
+
|
|
30
|
+
Dark mode is enabled with a `dark` class on `<html>`.
|
|
31
|
+
|
|
32
|
+
## Exports
|
|
33
|
+
|
|
34
|
+
The package has one entry, `@classic-homes/theme-tailwind-preset`, which exports the preset object (CommonJS `module.exports`; `import` works through Node's CJS interop).
|
package/index.js
CHANGED
|
@@ -139,6 +139,7 @@ module.exports = {
|
|
|
139
139
|
toolbar: {
|
|
140
140
|
DEFAULT: 'hsl(var(--toolbar))',
|
|
141
141
|
foreground: 'hsl(var(--toolbar-foreground))',
|
|
142
|
+
muted: 'hsl(var(--toolbar-muted))',
|
|
142
143
|
border: 'hsl(var(--toolbar-border))',
|
|
143
144
|
},
|
|
144
145
|
background: {
|
|
@@ -416,10 +417,12 @@ module.exports = {
|
|
|
416
417
|
'slide-right': `slide-right ${tokens.animation.duration.base} ease-out`,
|
|
417
418
|
'scale-in': `scale-in ${tokens.animation.duration.base} ease-out`,
|
|
418
419
|
'scale-out': `scale-out ${tokens.animation.duration.base} ease-out`,
|
|
419
|
-
|
|
420
|
+
// Looping animations take literal durations: the 500ms `slower` token made
|
|
421
|
+
// spin-slow twice as fast as Tailwind's 1s `spin` and the shimmer 4x too fast.
|
|
422
|
+
'spin-slow': 'spin-slow 2s linear infinite',
|
|
420
423
|
'pulse-subtle': `pulse-subtle ${tokens.transition.duration.slower} cubic-bezier(0.4, 0, 0.6, 1) infinite`,
|
|
421
424
|
'progress-indeterminate': 'progress-indeterminate 1.5s ease-in-out infinite',
|
|
422
|
-
shimmer:
|
|
425
|
+
shimmer: 'shimmer 2s linear infinite',
|
|
423
426
|
trace: `trace ${tokens.transition.duration.slower} linear infinite`,
|
|
424
427
|
|
|
425
428
|
// DataPanel animations
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classic-homes/theme-tailwind-preset",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Tailwind CSS preset for the Classic theme system",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"tailwindcss": "
|
|
29
|
+
"tailwindcss": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@classic-homes/theme-tokens": "*"
|