typewritingclass 0.2.1 → 0.2.3
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/dist/borders-pzt8w5Wv.d.cts +24 -0
- package/dist/borders-pzt8w5Wv.d.ts +24 -0
- package/dist/chunk-34VD2OBF.cjs +74 -0
- package/dist/chunk-6CEDQ6GF.cjs +36 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-ATLK64TQ.js +85 -0
- package/dist/chunk-BAZLFQIV.cjs +85 -0
- package/dist/chunk-CB7B6PHY.cjs +19 -0
- package/dist/chunk-EBHM46CV.cjs +25 -0
- package/dist/chunk-IL3LVS32.js +36 -0
- package/dist/chunk-JKT74FUK.js +25 -0
- package/dist/chunk-L3IF2OVA.cjs +354 -0
- package/{src/theme/animations.ts → dist/chunk-L7AJQJBR.js} +16 -8
- package/dist/chunk-LARVCDO3.js +113 -0
- package/dist/chunk-M34ZK4IV.cjs +53 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-PBQX6PVK.js +80 -0
- package/dist/chunk-PTY5FTFB.cjs +80 -0
- package/dist/chunk-T776FXQK.js +53 -0
- package/dist/chunk-TAAEIXRF.js +74 -0
- package/dist/chunk-TUUH2FJY.cjs +39 -0
- package/dist/chunk-U2LSMKZS.js +60 -0
- package/dist/chunk-UUUE7HRN.cjs +60 -0
- package/dist/chunk-UUVUSZJS.cjs +113 -0
- package/dist/chunk-XEHQXLQR.js +354 -0
- package/dist/chunk-YHDPOIUZ.js +39 -0
- package/dist/colors-MvgcZKUW.d.cts +72 -0
- package/dist/colors-MvgcZKUW.d.ts +72 -0
- package/dist/index.cjs +2922 -0
- package/dist/index.d.cts +3515 -0
- package/dist/index.d.ts +3515 -0
- package/dist/index.js +2922 -0
- package/{src/theme/inject-theme.ts → dist/inject-theme-CTzyfQH0.d.cts} +4 -20
- package/dist/inject-theme-CTzyfQH0.d.ts +65 -0
- package/dist/inject.cjs +32 -0
- package/dist/inject.d.cts +2 -0
- package/dist/inject.d.ts +2 -0
- package/dist/inject.js +32 -0
- package/dist/rule.cjs +19 -0
- package/{src/rule.ts → dist/rule.d.cts} +10 -79
- package/dist/rule.d.ts +133 -0
- package/dist/rule.js +19 -0
- package/dist/runtime.cjs +9 -0
- package/{src/runtime.ts → dist/runtime.d.cts} +4 -7
- package/dist/runtime.d.ts +33 -0
- package/dist/runtime.js +9 -0
- package/dist/shadows-CWViP1Zk.d.cts +22 -0
- package/dist/shadows-CWViP1Zk.d.ts +22 -0
- package/dist/sizes-CS9iz8YG.d.cts +46 -0
- package/dist/sizes-CS9iz8YG.d.ts +46 -0
- package/dist/theme/animations.cjs +15 -0
- package/dist/theme/animations.d.cts +12 -0
- package/dist/theme/animations.d.ts +12 -0
- package/dist/theme/animations.js +15 -0
- package/dist/theme/borders.cjs +23 -0
- package/dist/theme/borders.d.cts +1 -0
- package/dist/theme/borders.d.ts +1 -0
- package/dist/theme/borders.js +23 -0
- package/dist/theme/colors.cjs +57 -0
- package/dist/theme/colors.d.cts +1 -0
- package/dist/theme/colors.d.ts +1 -0
- package/dist/theme/colors.js +57 -0
- package/dist/theme/createTheme.cjs +7 -0
- package/dist/theme/createTheme.d.cts +133 -0
- package/dist/theme/createTheme.d.ts +133 -0
- package/dist/theme/createTheme.js +7 -0
- package/dist/theme/filters.cjs +9 -0
- package/dist/theme/filters.d.cts +21 -0
- package/dist/theme/filters.d.ts +21 -0
- package/dist/theme/filters.js +9 -0
- package/dist/theme/index.cjs +35 -0
- package/dist/theme/index.d.cts +18 -0
- package/dist/theme/index.d.ts +18 -0
- package/dist/theme/index.js +35 -0
- package/dist/theme/shadows.cjs +21 -0
- package/dist/theme/shadows.d.cts +1 -0
- package/dist/theme/shadows.d.ts +1 -0
- package/dist/theme/shadows.js +21 -0
- package/dist/theme/sizes.cjs +21 -0
- package/dist/theme/sizes.d.cts +1 -0
- package/dist/theme/sizes.d.ts +1 -0
- package/dist/theme/sizes.js +21 -0
- package/dist/theme/typography.cjs +55 -0
- package/dist/theme/typography.d.cts +1 -0
- package/dist/theme/typography.d.ts +1 -0
- package/dist/theme/typography.js +55 -0
- package/dist/types-FfRD4Hbd.d.cts +346 -0
- package/dist/types-FfRD4Hbd.d.ts +346 -0
- package/dist/typography-C8wipcCK.d.cts +87 -0
- package/dist/typography-C8wipcCK.d.ts +87 -0
- package/package.json +117 -33
- package/src/css.ts +0 -140
- package/src/cx.ts +0 -105
- package/src/dcx.ts +0 -79
- package/src/dynamic.ts +0 -117
- package/src/hash.ts +0 -55
- package/src/index.ts +0 -139
- package/src/inject.ts +0 -86
- package/src/layer.ts +0 -81
- package/src/modifiers/aria.ts +0 -15
- package/src/modifiers/colorScheme.ts +0 -32
- package/src/modifiers/data.ts +0 -6
- package/src/modifiers/direction.ts +0 -5
- package/src/modifiers/group.ts +0 -21
- package/src/modifiers/index.ts +0 -17
- package/src/modifiers/media.ts +0 -11
- package/src/modifiers/peer.ts +0 -24
- package/src/modifiers/pseudo.ts +0 -183
- package/src/modifiers/pseudoElements.ts +0 -26
- package/src/modifiers/responsive.ts +0 -110
- package/src/modifiers/supports.ts +0 -6
- package/src/registry.ts +0 -171
- package/src/theme/borders.ts +0 -9
- package/src/theme/colors.ts +0 -326
- package/src/theme/createTheme.ts +0 -238
- package/src/theme/filters.ts +0 -20
- package/src/theme/index.ts +0 -9
- package/src/theme/shadows.ts +0 -8
- package/src/theme/sizes.ts +0 -37
- package/src/theme/spacing.ts +0 -44
- package/src/theme/typography.ts +0 -72
- package/src/tw.ts +0 -960
- package/src/types.ts +0 -273
- package/src/utilities/accessibility.ts +0 -33
- package/src/utilities/backgrounds.ts +0 -87
- package/src/utilities/borders.ts +0 -629
- package/src/utilities/colors.ts +0 -151
- package/src/utilities/effects.ts +0 -181
- package/src/utilities/filters.ts +0 -113
- package/src/utilities/index.ts +0 -57
- package/src/utilities/interactivity.ts +0 -254
- package/src/utilities/layout.ts +0 -1194
- package/src/utilities/spacing.ts +0 -681
- package/src/utilities/svg.ts +0 -35
- package/src/utilities/tables.ts +0 -54
- package/src/utilities/transforms.ts +0 -88
- package/src/utilities/transitions.ts +0 -107
- package/src/utilities/typography.ts +0 -387
- package/src/when.ts +0 -63
package/src/theme/createTheme.ts
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration object for defining a theme's design tokens.
|
|
3
|
-
*
|
|
4
|
-
* Pass this to {@link createTheme} to generate CSS custom properties and
|
|
5
|
-
* a type-safe `vars` accessor for use in style utilities.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const config: ThemeConfig = {
|
|
10
|
-
* name: 'light',
|
|
11
|
-
* colors: {
|
|
12
|
-
* blue: { 500: '#3b82f6', 600: '#2563eb' },
|
|
13
|
-
* },
|
|
14
|
-
* spacing: { 4: '1rem', 8: '2rem' },
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export interface ThemeConfig {
|
|
19
|
-
/** Optional theme name. Defaults to `'default'` which targets `:root`. Any other name targets `[data-theme="<name>"]`. */
|
|
20
|
-
name?: string
|
|
21
|
-
/** Color palette scales, keyed by color name, then by shade (e.g., `{ blue: { 500: '#3b82f6' } }`). */
|
|
22
|
-
colors?: Record<string, Record<string | number, string>>
|
|
23
|
-
/** Spacing scale, keyed by size token (e.g., `{ 4: '1rem', 8: '2rem' }`). */
|
|
24
|
-
spacing?: Record<string | number, string>
|
|
25
|
-
/** Typography tokens for text sizes and font weights. */
|
|
26
|
-
typography?: {
|
|
27
|
-
/** Named text size presets with `fontSize` and `lineHeight` values. */
|
|
28
|
-
textSizes?: Record<string, { fontSize: string; lineHeight: string }>
|
|
29
|
-
/** Named font weight presets (e.g., `{ bold: '700' }`). */
|
|
30
|
-
fontWeights?: Record<string, string>
|
|
31
|
-
}
|
|
32
|
-
/** Named border style tokens (e.g., `{ default: '1px solid #e5e7eb' }`). */
|
|
33
|
-
borders?: Record<string, string>
|
|
34
|
-
/** Named box-shadow tokens (e.g., `{ md: '0 4px 6px rgba(0,0,0,0.1)' }`). */
|
|
35
|
-
shadows?: Record<string, string>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The result returned by {@link createTheme}.
|
|
40
|
-
*
|
|
41
|
-
* Contains the generated CSS text for injection and a `vars` object whose
|
|
42
|
-
* values are `var(--twc-...)` references ready to pass to style utilities.
|
|
43
|
-
*/
|
|
44
|
-
export interface ThemeResult {
|
|
45
|
-
/** The theme name, matching the `name` from {@link ThemeConfig} (defaults to `'default'`). */
|
|
46
|
-
name: string
|
|
47
|
-
/**
|
|
48
|
-
* A complete CSS rule string containing all custom property declarations.
|
|
49
|
-
*
|
|
50
|
-
* For the default theme this targets `:root`; for named themes it targets
|
|
51
|
-
* `[data-theme="<name>"]`. Inject with {@link injectTheme}.
|
|
52
|
-
*/
|
|
53
|
-
cssText: string
|
|
54
|
-
/** Type-safe accessor whose leaf values are `var(--twc-...)` CSS references. */
|
|
55
|
-
vars: ThemeVars
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Type-safe map of CSS `var()` references generated from a {@link ThemeConfig}.
|
|
60
|
-
*
|
|
61
|
-
* Every leaf value is a string like `var(--twc-color-blue-500)` that can be
|
|
62
|
-
* passed directly to style utilities such as `bg()`, `color()`, and `p()`.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```ts
|
|
66
|
-
* const { vars } = createTheme({ colors: { blue: { 500: '#3b82f6' } } })
|
|
67
|
-
* vars.colors.blue[500] // "var(--twc-color-blue-500)"
|
|
68
|
-
*
|
|
69
|
-
* // Use in style utilities:
|
|
70
|
-
* cx(bg(vars.colors.blue[500]))
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
export interface ThemeVars {
|
|
74
|
-
/** Color `var()` references, organized by color name and shade. */
|
|
75
|
-
colors: Record<string, Record<string | number, string>>
|
|
76
|
-
/** Spacing `var()` references, keyed by size token. */
|
|
77
|
-
spacing: Record<string | number, string>
|
|
78
|
-
/** Typography `var()` references for text sizes and font weights. */
|
|
79
|
-
typography: {
|
|
80
|
-
/** Text size `var()` references with `fontSize` and `lineHeight` keys. */
|
|
81
|
-
textSizes: Record<string, { fontSize: string; lineHeight: string }>
|
|
82
|
-
/** Font weight `var()` references keyed by weight name. */
|
|
83
|
-
fontWeights: Record<string, string>
|
|
84
|
-
}
|
|
85
|
-
/** Border `var()` references keyed by border name. */
|
|
86
|
-
borders: Record<string, string>
|
|
87
|
-
/** Shadow `var()` references keyed by shadow name. */
|
|
88
|
-
shadows: Record<string, string>
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Builds a CSS custom property name from the given path segments.
|
|
93
|
-
*
|
|
94
|
-
* @internal
|
|
95
|
-
* @param parts - One or more name segments to join with hyphens.
|
|
96
|
-
* @returns A CSS custom property name in the form `--twc-<parts joined by ->`.
|
|
97
|
-
*/
|
|
98
|
-
function varName(...parts: (string | number)[]): string {
|
|
99
|
-
return `--twc-${parts.join('-')}`
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Wraps a CSS custom property name in a `var()` reference.
|
|
104
|
-
*
|
|
105
|
-
* @internal
|
|
106
|
-
* @param name - The full custom property name (e.g., `--twc-color-blue-500`).
|
|
107
|
-
* @returns A CSS `var()` expression (e.g., `var(--twc-color-blue-500)`).
|
|
108
|
-
*/
|
|
109
|
-
function varRef(name: string): string {
|
|
110
|
-
return `var(${name})`
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Creates a theme from a configuration of design tokens.
|
|
115
|
-
*
|
|
116
|
-
* Converts all token values into CSS custom properties and returns:
|
|
117
|
-
* - `cssText`: a string ready to inject into a `<style>` element via {@link injectTheme}
|
|
118
|
-
* - `vars`: a mirrored object whose leaf values are `var(--twc-...)` references,
|
|
119
|
-
* suitable for passing directly into style utilities like `bg()`, `color()`, `p()`, etc.
|
|
120
|
-
*
|
|
121
|
-
* The default theme (no `name` or `name: 'default'`) targets the `:root` selector.
|
|
122
|
-
* Named themes target `[data-theme="<name>"]` and can be activated with {@link setTheme}.
|
|
123
|
-
*
|
|
124
|
-
* @param config - The theme configuration containing design tokens.
|
|
125
|
-
* @returns A {@link ThemeResult} with `name`, `cssText`, and `vars`.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```ts
|
|
129
|
-
* import { createTheme, injectTheme } from 'typewritingclass/theme'
|
|
130
|
-
* import { cx, bg, p } from 'typewritingclass'
|
|
131
|
-
*
|
|
132
|
-
* const { cssText, vars } = createTheme({
|
|
133
|
-
* name: 'light',
|
|
134
|
-
* colors: {
|
|
135
|
-
* blue: { 500: '#3b82f6', 600: '#2563eb' },
|
|
136
|
-
* gray: { 100: '#f3f4f6', 900: '#111827' },
|
|
137
|
-
* },
|
|
138
|
-
* spacing: { 4: '1rem', 8: '2rem' },
|
|
139
|
-
* shadows: { md: '0 4px 6px rgba(0,0,0,0.1)' },
|
|
140
|
-
* })
|
|
141
|
-
*
|
|
142
|
-
* // Inject the generated CSS custom properties into the document
|
|
143
|
-
* injectTheme(cssText)
|
|
144
|
-
*
|
|
145
|
-
* // Use vars in style utilities — they resolve to var(--twc-...) references
|
|
146
|
-
* cx(bg(vars.colors.blue[500]), p(vars.spacing[4]))
|
|
147
|
-
* // CSS: .abc { background-color: var(--twc-color-blue-500); padding: var(--twc-spacing-4); }
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
export function createTheme(config: ThemeConfig): ThemeResult {
|
|
151
|
-
const name = config.name ?? 'default'
|
|
152
|
-
const properties: string[] = []
|
|
153
|
-
|
|
154
|
-
// Build vars proxy objects that resolve to var() references
|
|
155
|
-
const colorVars: Record<string, Record<string | number, string>> = {}
|
|
156
|
-
const spacingVars: Record<string | number, string> = {}
|
|
157
|
-
const typographyVars: ThemeVars['typography'] = { textSizes: {}, fontWeights: {} }
|
|
158
|
-
const borderVars: Record<string, string> = {}
|
|
159
|
-
const shadowVars: Record<string, string> = {}
|
|
160
|
-
|
|
161
|
-
// Colors
|
|
162
|
-
if (config.colors) {
|
|
163
|
-
for (const [colorName, scale] of Object.entries(config.colors)) {
|
|
164
|
-
colorVars[colorName] = {}
|
|
165
|
-
for (const [shade, hex] of Object.entries(scale)) {
|
|
166
|
-
const vn = varName('color', colorName, shade)
|
|
167
|
-
properties.push(` ${vn}: ${hex};`)
|
|
168
|
-
colorVars[colorName][shade] = varRef(vn)
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Spacing
|
|
174
|
-
if (config.spacing) {
|
|
175
|
-
for (const [key, value] of Object.entries(config.spacing)) {
|
|
176
|
-
const vn = varName('spacing', key)
|
|
177
|
-
properties.push(` ${vn}: ${value};`)
|
|
178
|
-
spacingVars[key] = varRef(vn)
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Typography
|
|
183
|
-
if (config.typography?.textSizes) {
|
|
184
|
-
for (const [sizeName, size] of Object.entries(config.typography.textSizes)) {
|
|
185
|
-
const fsvn = varName('text', sizeName, 'fs')
|
|
186
|
-
const lhvn = varName('text', sizeName, 'lh')
|
|
187
|
-
properties.push(` ${fsvn}: ${size.fontSize};`)
|
|
188
|
-
properties.push(` ${lhvn}: ${size.lineHeight};`)
|
|
189
|
-
typographyVars.textSizes[sizeName] = {
|
|
190
|
-
fontSize: varRef(fsvn),
|
|
191
|
-
lineHeight: varRef(lhvn),
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (config.typography?.fontWeights) {
|
|
196
|
-
for (const [weightName, weight] of Object.entries(config.typography.fontWeights)) {
|
|
197
|
-
const vn = varName('font', weightName)
|
|
198
|
-
properties.push(` ${vn}: ${weight};`)
|
|
199
|
-
typographyVars.fontWeights[weightName] = varRef(vn)
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Borders
|
|
204
|
-
if (config.borders) {
|
|
205
|
-
for (const [borderName, value] of Object.entries(config.borders)) {
|
|
206
|
-
const vn = varName('border', borderName)
|
|
207
|
-
properties.push(` ${vn}: ${value};`)
|
|
208
|
-
borderVars[borderName] = varRef(vn)
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Shadows
|
|
213
|
-
if (config.shadows) {
|
|
214
|
-
for (const [shadowName, value] of Object.entries(config.shadows)) {
|
|
215
|
-
const vn = varName('shadow', shadowName)
|
|
216
|
-
properties.push(` ${vn}: ${value};`)
|
|
217
|
-
shadowVars[shadowName] = varRef(vn)
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// Build CSS text
|
|
222
|
-
const selector = name === 'default' ? ':root' : `[data-theme="${name}"]`
|
|
223
|
-
const cssText = properties.length > 0
|
|
224
|
-
? `${selector} {\n${properties.join('\n')}\n}`
|
|
225
|
-
: ''
|
|
226
|
-
|
|
227
|
-
return {
|
|
228
|
-
name,
|
|
229
|
-
cssText,
|
|
230
|
-
vars: {
|
|
231
|
-
colors: colorVars,
|
|
232
|
-
spacing: spacingVars,
|
|
233
|
-
typography: typographyVars,
|
|
234
|
-
borders: borderVars,
|
|
235
|
-
shadows: shadowVars,
|
|
236
|
-
},
|
|
237
|
-
}
|
|
238
|
-
}
|
package/src/theme/filters.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const blur = {
|
|
2
|
-
none: '0',
|
|
3
|
-
sm: '4px',
|
|
4
|
-
DEFAULT: '8px',
|
|
5
|
-
md: '12px',
|
|
6
|
-
lg: '16px',
|
|
7
|
-
xl: '24px',
|
|
8
|
-
_2xl: '40px',
|
|
9
|
-
_3xl: '64px',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const dropShadow = {
|
|
13
|
-
sm: '0 1px 1px rgb(0 0 0 / 0.05)',
|
|
14
|
-
DEFAULT: '0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06)',
|
|
15
|
-
md: '0 4px 3px rgb(0 0 0 / 0.07), 0 2px 2px rgb(0 0 0 / 0.06)',
|
|
16
|
-
lg: '0 10px 8px rgb(0 0 0 / 0.04), 0 4px 3px rgb(0 0 0 / 0.1)',
|
|
17
|
-
xl: '0 20px 13px rgb(0 0 0 / 0.03), 0 8px 5px rgb(0 0 0 / 0.08)',
|
|
18
|
-
_2xl: '0 25px 25px rgb(0 0 0 / 0.15)',
|
|
19
|
-
none: '0 0 #0000',
|
|
20
|
-
}
|
package/src/theme/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * as colors from './colors.ts'
|
|
2
|
-
export * as spacing from './spacing.ts'
|
|
3
|
-
export * as typography from './typography.ts'
|
|
4
|
-
export * as sizes from './sizes.ts'
|
|
5
|
-
export * as shadows from './shadows.ts'
|
|
6
|
-
export * as borders from './borders.ts'
|
|
7
|
-
export { createTheme } from './createTheme.ts'
|
|
8
|
-
export type { ThemeConfig, ThemeResult, ThemeVars } from './createTheme.ts'
|
|
9
|
-
export { injectTheme, setTheme } from './inject-theme.ts'
|
package/src/theme/shadows.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const sm = '0 1px 2px 0 rgb(0 0 0 / 0.05)'
|
|
2
|
-
export const DEFAULT = '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)'
|
|
3
|
-
export const md = '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'
|
|
4
|
-
export const lg = '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'
|
|
5
|
-
export const xl = '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)'
|
|
6
|
-
export const _2xl = '0 25px 50px -12px rgb(0 0 0 / 0.25)'
|
|
7
|
-
export const inner = 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)'
|
|
8
|
-
export const none = '0 0 #0000'
|
package/src/theme/sizes.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export const full = '100%'
|
|
2
|
-
export const screen = '100vw'
|
|
3
|
-
export const screenH = '100vh'
|
|
4
|
-
export const min = 'min-content'
|
|
5
|
-
export const max = 'max-content'
|
|
6
|
-
export const fit = 'fit-content'
|
|
7
|
-
export const auto = 'auto'
|
|
8
|
-
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Max-width scale (Tailwind v3 defaults)
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
export const maxWidths = {
|
|
14
|
-
none: 'none',
|
|
15
|
-
0: '0rem',
|
|
16
|
-
xs: '20rem',
|
|
17
|
-
sm: '24rem',
|
|
18
|
-
md: '28rem',
|
|
19
|
-
lg: '32rem',
|
|
20
|
-
xl: '36rem',
|
|
21
|
-
'2xl': '42rem',
|
|
22
|
-
'3xl': '48rem',
|
|
23
|
-
'4xl': '56rem',
|
|
24
|
-
'5xl': '64rem',
|
|
25
|
-
'6xl': '72rem',
|
|
26
|
-
'7xl': '80rem',
|
|
27
|
-
full: '100%',
|
|
28
|
-
min: 'min-content',
|
|
29
|
-
max: 'max-content',
|
|
30
|
-
fit: 'fit-content',
|
|
31
|
-
prose: '65ch',
|
|
32
|
-
screenSm: '640px',
|
|
33
|
-
screenMd: '768px',
|
|
34
|
-
screenLg: '1024px',
|
|
35
|
-
screenXl: '1280px',
|
|
36
|
-
screen2xl: '1536px',
|
|
37
|
-
} as const
|
package/src/theme/spacing.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const spacingScale: Record<number, string> = {
|
|
2
|
-
0: '0px',
|
|
3
|
-
0.5: '0.125rem',
|
|
4
|
-
1: '0.25rem',
|
|
5
|
-
1.5: '0.375rem',
|
|
6
|
-
2: '0.5rem',
|
|
7
|
-
2.5: '0.625rem',
|
|
8
|
-
3: '0.75rem',
|
|
9
|
-
3.5: '0.875rem',
|
|
10
|
-
4: '1rem',
|
|
11
|
-
5: '1.25rem',
|
|
12
|
-
6: '1.5rem',
|
|
13
|
-
7: '1.75rem',
|
|
14
|
-
8: '2rem',
|
|
15
|
-
9: '2.25rem',
|
|
16
|
-
10: '2.5rem',
|
|
17
|
-
11: '2.75rem',
|
|
18
|
-
12: '3rem',
|
|
19
|
-
14: '3.5rem',
|
|
20
|
-
16: '4rem',
|
|
21
|
-
20: '5rem',
|
|
22
|
-
24: '6rem',
|
|
23
|
-
28: '7rem',
|
|
24
|
-
32: '8rem',
|
|
25
|
-
36: '9rem',
|
|
26
|
-
40: '10rem',
|
|
27
|
-
44: '11rem',
|
|
28
|
-
48: '12rem',
|
|
29
|
-
52: '13rem',
|
|
30
|
-
56: '14rem',
|
|
31
|
-
60: '15rem',
|
|
32
|
-
64: '16rem',
|
|
33
|
-
72: '18rem',
|
|
34
|
-
80: '20rem',
|
|
35
|
-
96: '24rem',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function resolveSpacing(value: number | string): string {
|
|
39
|
-
if (typeof value === 'string') return value
|
|
40
|
-
if (value in spacingScale) return spacingScale[value]
|
|
41
|
-
return `${value * 0.25}rem`
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { spacingScale }
|
package/src/theme/typography.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export interface TextSize {
|
|
2
|
-
fontSize: string
|
|
3
|
-
lineHeight: string
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const xs: TextSize = { fontSize: '0.75rem', lineHeight: '1rem' }
|
|
7
|
-
export const sm: TextSize = { fontSize: '0.875rem', lineHeight: '1.25rem' }
|
|
8
|
-
export const base: TextSize = { fontSize: '1rem', lineHeight: '1.5rem' }
|
|
9
|
-
export const lg: TextSize = { fontSize: '1.125rem', lineHeight: '1.75rem' }
|
|
10
|
-
export const xl: TextSize = { fontSize: '1.25rem', lineHeight: '1.75rem' }
|
|
11
|
-
export const _2xl: TextSize = { fontSize: '1.5rem', lineHeight: '2rem' }
|
|
12
|
-
export const _3xl: TextSize = { fontSize: '1.875rem', lineHeight: '2.25rem' }
|
|
13
|
-
export const _4xl: TextSize = { fontSize: '2.25rem', lineHeight: '2.5rem' }
|
|
14
|
-
export const _5xl: TextSize = { fontSize: '3rem', lineHeight: '1' }
|
|
15
|
-
export const _6xl: TextSize = { fontSize: '3.75rem', lineHeight: '1' }
|
|
16
|
-
export const _7xl: TextSize = { fontSize: '4.5rem', lineHeight: '1' }
|
|
17
|
-
export const _8xl: TextSize = { fontSize: '6rem', lineHeight: '1' }
|
|
18
|
-
export const _9xl: TextSize = { fontSize: '8rem', lineHeight: '1' }
|
|
19
|
-
|
|
20
|
-
export const thin = '100'
|
|
21
|
-
export const extralight = '200'
|
|
22
|
-
export const light = '300'
|
|
23
|
-
export const normal = '400'
|
|
24
|
-
export const medium = '500'
|
|
25
|
-
export const semibold = '600'
|
|
26
|
-
export const bold = '700'
|
|
27
|
-
export const extrabold = '800'
|
|
28
|
-
export const black_ = '900'
|
|
29
|
-
|
|
30
|
-
// ---------------------------------------------------------------------------
|
|
31
|
-
// Font families (Tailwind v3 defaults)
|
|
32
|
-
// ---------------------------------------------------------------------------
|
|
33
|
-
|
|
34
|
-
export const fontFamilies = {
|
|
35
|
-
sans: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
36
|
-
serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
37
|
-
mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
38
|
-
} as const
|
|
39
|
-
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
// Letter spacing / tracking (Tailwind v3 defaults)
|
|
42
|
-
// ---------------------------------------------------------------------------
|
|
43
|
-
|
|
44
|
-
export const letterSpacings = {
|
|
45
|
-
tighter: '-0.05em',
|
|
46
|
-
tight: '-0.025em',
|
|
47
|
-
normal: '0em',
|
|
48
|
-
wide: '0.025em',
|
|
49
|
-
wider: '0.05em',
|
|
50
|
-
widest: '0.1em',
|
|
51
|
-
} as const
|
|
52
|
-
|
|
53
|
-
// ---------------------------------------------------------------------------
|
|
54
|
-
// Line height / leading (Tailwind v3 defaults)
|
|
55
|
-
// ---------------------------------------------------------------------------
|
|
56
|
-
|
|
57
|
-
export const lineHeights = {
|
|
58
|
-
none: '1',
|
|
59
|
-
tight: '1.25',
|
|
60
|
-
snug: '1.375',
|
|
61
|
-
normal: '1.5',
|
|
62
|
-
relaxed: '1.625',
|
|
63
|
-
loose: '2',
|
|
64
|
-
'3': '.75rem',
|
|
65
|
-
'4': '1rem',
|
|
66
|
-
'5': '1.25rem',
|
|
67
|
-
'6': '1.5rem',
|
|
68
|
-
'7': '1.75rem',
|
|
69
|
-
'8': '2rem',
|
|
70
|
-
'9': '2.25rem',
|
|
71
|
-
'10': '2.5rem',
|
|
72
|
-
} as const
|