@classic-homes/theme-tailwind-preset 0.4.1 → 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.
- package/README.md +34 -0
- package/index.js +6 -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
|
@@ -42,7 +42,8 @@ const tokens = require('@classic-homes/theme-tokens');
|
|
|
42
42
|
// Exposed as `text-h1`..`text-h6` and emitted on the bare elements by
|
|
43
43
|
// `headingBase` below, so the two never drift.
|
|
44
44
|
const headingScale = {
|
|
45
|
-
|
|
45
|
+
// 2.75rem leading: a 2rem line on 40px type made wrapped titles overlap
|
|
46
|
+
h1: ['2.5rem', { lineHeight: '2.75rem', fontWeight: '500' }], // 40px
|
|
46
47
|
h2: ['1.75rem', { lineHeight: '2.25rem', fontWeight: '600' }], // 28px
|
|
47
48
|
h3: ['1.5rem', { lineHeight: '2rem', fontWeight: '600' }], // 24px
|
|
48
49
|
h4: ['1.25rem', { lineHeight: '1.75rem', fontWeight: '600' }], // 20px
|
|
@@ -415,10 +416,12 @@ module.exports = {
|
|
|
415
416
|
'slide-right': `slide-right ${tokens.animation.duration.base} ease-out`,
|
|
416
417
|
'scale-in': `scale-in ${tokens.animation.duration.base} ease-out`,
|
|
417
418
|
'scale-out': `scale-out ${tokens.animation.duration.base} ease-out`,
|
|
418
|
-
|
|
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',
|
|
419
422
|
'pulse-subtle': `pulse-subtle ${tokens.transition.duration.slower} cubic-bezier(0.4, 0, 0.6, 1) infinite`,
|
|
420
423
|
'progress-indeterminate': 'progress-indeterminate 1.5s ease-in-out infinite',
|
|
421
|
-
shimmer:
|
|
424
|
+
shimmer: 'shimmer 2s linear infinite',
|
|
422
425
|
trace: `trace ${tokens.transition.duration.slower} linear infinite`,
|
|
423
426
|
|
|
424
427
|
// 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.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": "
|
|
29
|
+
"tailwindcss": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@classic-homes/theme-tokens": "*"
|