@classic-homes/theme-tailwind-preset 0.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.
Files changed (2) hide show
  1. package/index.js +277 -0
  2. package/package.json +32 -0
package/index.js ADDED
@@ -0,0 +1,277 @@
1
+ /**
2
+ * Tailwind CSS Preset for Classic Theme
3
+ *
4
+ * This preset configures Tailwind CSS to use the Classic Homes brand design tokens.
5
+ * Import this in your tailwind.config.js to use the theme.
6
+ *
7
+ * Usage:
8
+ * ```js
9
+ * import preset from '@classic-theme/tailwind-preset';
10
+ *
11
+ * export default {
12
+ * presets: [preset],
13
+ * content: [
14
+ * './src/**\/*.{html,js,svelte,ts}',
15
+ * './node_modules/@classic-theme/svelte/**\/*.{html,js,svelte,ts}',
16
+ * ],
17
+ * };
18
+ * ```
19
+ */
20
+
21
+ const tokens = require('@classic-theme/tokens');
22
+
23
+ /** @type {import('tailwindcss').Config} */
24
+ module.exports = {
25
+ // Enable dark mode via class on <html> element
26
+ darkMode: ['class'],
27
+
28
+ theme: {
29
+ // Container with brand max-widths
30
+ container: {
31
+ center: true,
32
+ padding: {
33
+ DEFAULT: '1rem',
34
+ sm: '2rem',
35
+ lg: '4rem',
36
+ xl: '5rem',
37
+ '2xl': '6rem',
38
+ },
39
+ screens: {
40
+ sm: '640px',
41
+ md: '768px',
42
+ lg: '1024px',
43
+ xl: '1280px',
44
+ '2xl': '1400px', // Slightly narrower for better readability
45
+ },
46
+ },
47
+
48
+ extend: {
49
+ // Brand color palettes
50
+ colors: {
51
+ // Neutrals
52
+ gray: tokens.colors.gray,
53
+
54
+ // Brand colors
55
+ red: tokens.colors.red,
56
+ teal: tokens.colors.teal,
57
+ navy: tokens.colors.navy,
58
+ plum: tokens.colors.plum,
59
+ sage: tokens.colors.sage,
60
+
61
+ // Collection colors
62
+ stone: tokens.colors.stone,
63
+ forest: tokens.colors.forest,
64
+ lavender: tokens.colors.lavender,
65
+ sky: tokens.colors.sky,
66
+ deepTeal: tokens.colors.deepTeal,
67
+ charcoal: tokens.colors.charcoal,
68
+
69
+ // Semantic color utilities (using CSS variables for theming)
70
+ border: 'hsl(var(--border))',
71
+ input: 'hsl(var(--input))',
72
+ ring: 'hsl(var(--ring))',
73
+ background: 'hsl(var(--background))',
74
+ foreground: 'hsl(var(--foreground))',
75
+
76
+ primary: {
77
+ DEFAULT: 'hsl(var(--primary))',
78
+ foreground: 'hsl(var(--primary-foreground))',
79
+ },
80
+ secondary: {
81
+ DEFAULT: 'hsl(var(--secondary))',
82
+ foreground: 'hsl(var(--secondary-foreground))',
83
+ },
84
+ destructive: {
85
+ DEFAULT: 'hsl(var(--destructive))',
86
+ foreground: 'hsl(var(--destructive-foreground))',
87
+ },
88
+ muted: {
89
+ DEFAULT: 'hsl(var(--muted))',
90
+ foreground: 'hsl(var(--muted-foreground))',
91
+ },
92
+ accent: {
93
+ DEFAULT: 'hsl(var(--accent))',
94
+ foreground: 'hsl(var(--accent-foreground))',
95
+ },
96
+ popover: {
97
+ DEFAULT: 'hsl(var(--popover))',
98
+ foreground: 'hsl(var(--popover-foreground))',
99
+ },
100
+ card: {
101
+ DEFAULT: 'hsl(var(--card))',
102
+ foreground: 'hsl(var(--card-foreground))',
103
+ },
104
+
105
+ // Status colors (for alerts, notifications, feedback)
106
+ success: {
107
+ DEFAULT: 'hsl(var(--success))',
108
+ foreground: 'hsl(var(--success-foreground))',
109
+ },
110
+ warning: {
111
+ DEFAULT: 'hsl(var(--warning))',
112
+ foreground: 'hsl(var(--warning-foreground))',
113
+ },
114
+ info: {
115
+ DEFAULT: 'hsl(var(--info))',
116
+ foreground: 'hsl(var(--info-foreground))',
117
+ },
118
+
119
+ // Layout colors
120
+ 'content-bg': 'hsl(var(--content-bg))',
121
+ 'surface-border': 'hsl(var(--surface-border))',
122
+
123
+ // Sidebar colors
124
+ sidebar: {
125
+ DEFAULT: 'hsl(var(--sidebar-background))',
126
+ foreground: 'hsl(var(--sidebar-foreground))',
127
+ primary: 'hsl(var(--sidebar-primary))',
128
+ 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
129
+ accent: 'hsl(var(--sidebar-accent))',
130
+ 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
131
+ border: 'hsl(var(--sidebar-border))',
132
+ ring: 'hsl(var(--sidebar-ring))',
133
+ },
134
+
135
+ // Chart colors
136
+ chart: {
137
+ 1: 'hsl(var(--chart-1))',
138
+ 2: 'hsl(var(--chart-2))',
139
+ 3: 'hsl(var(--chart-3))',
140
+ 4: 'hsl(var(--chart-4))',
141
+ 5: 'hsl(var(--chart-5))',
142
+ },
143
+
144
+ // Brand colors (direct hex for exact matching)
145
+ brand: {
146
+ 'red-logo': 'var(--color-red-logo)',
147
+ 'red-primary': 'var(--color-red-primary)',
148
+ 'grey-1': 'var(--color-grey-1)',
149
+ 'grey-2': 'var(--color-grey-2)',
150
+ 'core-1': 'var(--color-core-1)',
151
+ 'core-2': 'var(--color-core-2)',
152
+ 'core-3': 'var(--color-core-3)',
153
+ 'core-4': 'var(--color-core-4)',
154
+ 'core-4-tint': 'var(--color-core-4-tint)',
155
+ },
156
+ },
157
+
158
+ spacing: tokens.spacing,
159
+
160
+ fontFamily: tokens.fontFamily,
161
+
162
+ fontSize: {
163
+ ...tokens.fontSize,
164
+ // Heading sizes for typography scale
165
+ h1: ['2.25rem', { lineHeight: '2.5rem', fontWeight: '600' }], // 36px
166
+ h2: ['1.875rem', { lineHeight: '2.25rem', fontWeight: '600' }], // 30px
167
+ h3: ['1.5rem', { lineHeight: '2rem', fontWeight: '600' }], // 24px
168
+ h4: ['1.25rem', { lineHeight: '1.75rem', fontWeight: '600' }], // 20px
169
+ h5: ['1.125rem', { lineHeight: '1.75rem', fontWeight: '600' }], // 18px
170
+ h6: ['1rem', { lineHeight: '1.5rem', fontWeight: '600' }], // 16px
171
+ },
172
+
173
+ fontWeight: tokens.fontWeight,
174
+
175
+ borderRadius: {
176
+ ...tokens.borderRadius,
177
+ lg: 'var(--radius)',
178
+ md: 'calc(var(--radius) - 2px)',
179
+ sm: 'calc(var(--radius) - 4px)',
180
+ },
181
+
182
+ boxShadow: tokens.boxShadow,
183
+
184
+ zIndex: tokens.zIndex,
185
+
186
+ screens: tokens.breakpoints,
187
+
188
+ transitionDuration: tokens.transition.duration,
189
+
190
+ transitionTimingFunction: tokens.transition.timing,
191
+
192
+ keyframes: {
193
+ // Accordion animations (Radix/Bits UI)
194
+ 'accordion-down': {
195
+ from: { height: '0' },
196
+ to: { height: 'var(--radix-accordion-content-height)' },
197
+ },
198
+ 'accordion-up': {
199
+ from: { height: 'var(--radix-accordion-content-height)' },
200
+ to: { height: '0' },
201
+ },
202
+ // Collapsible animations
203
+ 'collapsible-down': {
204
+ from: { height: '0' },
205
+ to: { height: 'var(--bits-collapsible-content-height)' },
206
+ },
207
+ 'collapsible-up': {
208
+ from: { height: 'var(--bits-collapsible-content-height)' },
209
+ to: { height: '0' },
210
+ },
211
+ // Fade animations
212
+ 'fade-in': {
213
+ from: { opacity: '0' },
214
+ to: { opacity: '1' },
215
+ },
216
+ 'fade-out': {
217
+ from: { opacity: '1' },
218
+ to: { opacity: '0' },
219
+ },
220
+ // Slide animations
221
+ 'slide-up': {
222
+ from: { opacity: '0', transform: 'translateY(10px)' },
223
+ to: { opacity: '1', transform: 'translateY(0)' },
224
+ },
225
+ 'slide-down': {
226
+ from: { opacity: '0', transform: 'translateY(-10px)' },
227
+ to: { opacity: '1', transform: 'translateY(0)' },
228
+ },
229
+ 'slide-left': {
230
+ from: { opacity: '0', transform: 'translateX(10px)' },
231
+ to: { opacity: '1', transform: 'translateX(0)' },
232
+ },
233
+ 'slide-right': {
234
+ from: { opacity: '0', transform: 'translateX(-10px)' },
235
+ to: { opacity: '1', transform: 'translateX(0)' },
236
+ },
237
+ // Scale animations
238
+ 'scale-in': {
239
+ from: { opacity: '0', transform: 'scale(0.95)' },
240
+ to: { opacity: '1', transform: 'scale(1)' },
241
+ },
242
+ 'scale-out': {
243
+ from: { opacity: '1', transform: 'scale(1)' },
244
+ to: { opacity: '0', transform: 'scale(0.95)' },
245
+ },
246
+ // Spinner
247
+ 'spin-slow': {
248
+ from: { transform: 'rotate(0deg)' },
249
+ to: { transform: 'rotate(360deg)' },
250
+ },
251
+ // Pulse
252
+ 'pulse-subtle': {
253
+ '0%, 100%': { opacity: '1' },
254
+ '50%': { opacity: '0.7' },
255
+ },
256
+ },
257
+
258
+ animation: {
259
+ 'accordion-down': 'accordion-down 0.2s ease-out',
260
+ 'accordion-up': 'accordion-up 0.2s ease-out',
261
+ 'collapsible-down': 'collapsible-down 0.2s ease-out',
262
+ 'collapsible-up': 'collapsible-up 0.2s ease-out',
263
+ 'fade-in': 'fade-in 0.2s ease-out',
264
+ 'fade-out': 'fade-out 0.2s ease-out',
265
+ 'slide-up': 'slide-up 0.2s ease-out',
266
+ 'slide-down': 'slide-down 0.2s ease-out',
267
+ 'slide-left': 'slide-left 0.2s ease-out',
268
+ 'slide-right': 'slide-right 0.2s ease-out',
269
+ 'scale-in': 'scale-in 0.2s ease-out',
270
+ 'scale-out': 'scale-out 0.2s ease-out',
271
+ 'spin-slow': 'spin-slow 2s linear infinite',
272
+ 'pulse-subtle': 'pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
273
+ },
274
+ },
275
+ },
276
+ plugins: [],
277
+ };
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@classic-homes/theme-tailwind-preset",
3
+ "version": "0.1.0",
4
+ "description": "Tailwind CSS preset for the Classic theme system",
5
+ "main": "index.js",
6
+ "files": [
7
+ "index.js"
8
+ ],
9
+ "scripts": {
10
+ "build": "echo 'No build needed for tailwind-preset'"
11
+ },
12
+ "keywords": [
13
+ "tailwindcss",
14
+ "preset",
15
+ "theme"
16
+ ],
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/Classic-Homes/classic-theme.git",
21
+ "directory": "packages/tailwind-preset"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "peerDependencies": {
27
+ "tailwindcss": ">=3.0.0"
28
+ },
29
+ "dependencies": {
30
+ "@classic-homes/theme-tokens": "*"
31
+ }
32
+ }