@classic-homes/theme-tailwind-preset 0.4.2 → 0.6.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.
Files changed (3) hide show
  1. package/README.md +34 -0
  2. package/index.js +4 -2
  3. 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
@@ -416,10 +416,12 @@ module.exports = {
416
416
  'slide-right': `slide-right ${tokens.animation.duration.base} ease-out`,
417
417
  'scale-in': `scale-in ${tokens.animation.duration.base} ease-out`,
418
418
  'scale-out': `scale-out ${tokens.animation.duration.base} ease-out`,
419
- 'spin-slow': `spin-slow ${tokens.transition.duration.slower} linear infinite`,
419
+ // Looping animations take literal durations: the 500ms `slower` token made
420
+ // spin-slow twice as fast as Tailwind's 1s `spin` and the shimmer 4x too fast.
421
+ 'spin-slow': 'spin-slow 2s linear infinite',
420
422
  'pulse-subtle': `pulse-subtle ${tokens.transition.duration.slower} cubic-bezier(0.4, 0, 0.6, 1) infinite`,
421
423
  'progress-indeterminate': 'progress-indeterminate 1.5s ease-in-out infinite',
422
- shimmer: `shimmer ${tokens.transition.duration.slower} linear infinite`,
424
+ shimmer: 'shimmer 2s linear infinite',
423
425
  trace: `trace ${tokens.transition.duration.slower} linear infinite`,
424
426
 
425
427
  // DataPanel animations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/theme-tailwind-preset",
3
- "version": "0.4.2",
3
+ "version": "0.6.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": ">=3.0.0"
29
+ "tailwindcss": "^3.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "@classic-homes/theme-tokens": "*"