prewindcss 1.0.0 → 1.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.
- package/README.md +11 -12
- package/package.json +9 -1
- package/script/prewindcss.js +21 -0
- package/script/shared.js +267 -0
- package/script/space.js +52 -0
- package/script/text.js +49 -0
- package/theme.css +30 -29
package/README.md
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
TODO: Before publishing, replace these placeholders:
|
|
3
|
-
|
|
4
|
-
- [CDN_URL] - The actual CDN URL for prewind.css
|
|
5
|
-
- [GITHUB_THEME_URL] - The URL to the default theme.css in the GitHub repo
|
|
6
|
-
- [NPX_FLUID_COMMAND] - The npx command to generate fluid font and space sizes
|
|
7
|
-
-->
|
|
8
|
-
|
|
9
1
|
# Prewind
|
|
10
2
|
|
|
11
3
|
A lightweight CSS utility library with no build step. Prewind provides the most useful utilities for everyday styling while encouraging a simpler, more maintainable approach to CSS. The entire library is ~7KB gzipped. No build step, no purging, no tree-shaking — just one CSS file.
|
|
@@ -33,14 +25,14 @@ Prewind works with the platform, not around it. CSS already has a cascade, varia
|
|
|
33
25
|
Load Prewind from a CDN or host it yourself:
|
|
34
26
|
|
|
35
27
|
```html
|
|
36
|
-
<link rel="stylesheet" href="
|
|
28
|
+
<link rel="stylesheet" href="https://unpkg.com/prewindcss@1.0.0" />
|
|
37
29
|
```
|
|
38
30
|
|
|
39
31
|
### 2. Define your theme variables
|
|
40
32
|
|
|
41
33
|
Prewind's utility classes reference CSS variables for colors, spacing, fonts, and other design tokens. You need to define these variables somewhere in your CSS — either in a separate file, or at the top of your global stylesheet.
|
|
42
34
|
|
|
43
|
-
You can copy the [default theme](
|
|
35
|
+
You can copy the [default theme](https://github.com/codepilotsf/prewind/blob/main/theme.css) from the repository and customize it, or define the variables yourself:
|
|
44
36
|
|
|
45
37
|
```css
|
|
46
38
|
:root {
|
|
@@ -120,10 +112,17 @@ This gives you responsive typography and spacing without writing media queries,
|
|
|
120
112
|
To generate custom fluid sizes for your project:
|
|
121
113
|
|
|
122
114
|
```bash
|
|
123
|
-
|
|
115
|
+
npx prewindcss text # Generate fluid typography scale
|
|
116
|
+
npx prewindcss space # Generate fluid spacing scale
|
|
124
117
|
```
|
|
125
118
|
|
|
126
|
-
|
|
119
|
+
Each command launches an interactive configurator where you can adjust:
|
|
120
|
+
|
|
121
|
+
- Viewport range (min/max)
|
|
122
|
+
- Base size at each viewport
|
|
123
|
+
- Scale ratio (using musical intervals like Major Third, Perfect Fifth, etc.)
|
|
124
|
+
|
|
125
|
+
The generated CSS is copied to your clipboard — just paste it into your theme variables.
|
|
127
126
|
|
|
128
127
|
Note: The t-shirt sizes used for borders (`--border-sm`, `--border-lg`), border radius (`--rounded-sm`, `--rounded-lg`), and shadows (`shadow-sm`, `shadow-lg`, are not fluid — they're fixed values you set manually in your theme variables.
|
|
129
128
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prewindcss",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Lightweight, no-build Tailwind alternative",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "prewind.css",
|
|
6
7
|
"style": "prewind.css",
|
|
8
|
+
"unpkg": "prewind.css",
|
|
9
|
+
"bin": {
|
|
10
|
+
"prewindcss": "./script/prewindcss.js"
|
|
11
|
+
},
|
|
7
12
|
"keywords": [
|
|
8
13
|
"Tailwind",
|
|
9
14
|
"CSS",
|
|
@@ -14,6 +19,9 @@
|
|
|
14
19
|
],
|
|
15
20
|
"author": "Codepilot",
|
|
16
21
|
"license": "MIT",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"enquirer": "^2.4.1"
|
|
24
|
+
},
|
|
17
25
|
"repository": {
|
|
18
26
|
"type": "git",
|
|
19
27
|
"url": "git+https://github.com/codepilotsf/prewind.git"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Prewind CSS CLI
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx prewindcss text - Generate fluid typography scale
|
|
8
|
+
* npx prewindcss space - Generate fluid spacing scale
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const command = process.argv[2];
|
|
12
|
+
|
|
13
|
+
if (command === 'text') {
|
|
14
|
+
const { run } = await import('./text.js');
|
|
15
|
+
run();
|
|
16
|
+
} else if (command === 'space') {
|
|
17
|
+
const { run } = await import('./space.js');
|
|
18
|
+
run();
|
|
19
|
+
} else {
|
|
20
|
+
console.log('Did you mean to run npx prewindcss text or npx prewindcss space?');
|
|
21
|
+
}
|
package/script/shared.js
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for Prewind CSS CLI
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import enquirer from "enquirer";
|
|
6
|
+
const { Select, NumberPrompt } = enquirer;
|
|
7
|
+
|
|
8
|
+
// -----------------------------------------------------------------------------
|
|
9
|
+
// Clamp Calculation
|
|
10
|
+
// -----------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Calculate a CSS clamp() value for a given step in the modular scale.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} config - Scale configuration
|
|
16
|
+
* @param {number} config.minViewport - Min viewport width in px
|
|
17
|
+
* @param {number} config.maxViewport - Max viewport width in px
|
|
18
|
+
* @param {number} config.minBase - Base size at min viewport in px
|
|
19
|
+
* @param {number} config.maxBase - Base size at max viewport in px
|
|
20
|
+
* @param {number} config.minRatio - Scale ratio at min viewport
|
|
21
|
+
* @param {number} config.maxRatio - Scale ratio at max viewport
|
|
22
|
+
* @param {number} step - The step in the modular scale (0 = base)
|
|
23
|
+
* @returns {string} CSS clamp() value
|
|
24
|
+
*/
|
|
25
|
+
export function calculateClamp(config, step) {
|
|
26
|
+
const { minViewport, maxViewport, minBase, maxBase, minRatio, maxRatio } =
|
|
27
|
+
config;
|
|
28
|
+
|
|
29
|
+
// Calculate size at min and max viewports using modular scale
|
|
30
|
+
const minSize = minBase * Math.pow(minRatio, step);
|
|
31
|
+
const maxSize = maxBase * Math.pow(maxRatio, step);
|
|
32
|
+
|
|
33
|
+
// Utopia formula: calculate slope and intercept in pixels, then convert
|
|
34
|
+
// slope = (maxSize - minSize) / (maxWidth - minWidth)
|
|
35
|
+
// intercept = minSize - (slope * minWidth)
|
|
36
|
+
const slope = (maxSize - minSize) / (maxViewport - minViewport);
|
|
37
|
+
const intercept = minSize - slope * minViewport;
|
|
38
|
+
|
|
39
|
+
// Convert to CSS units: rem (÷16) and vw (×100)
|
|
40
|
+
const minRem = minSize / 16;
|
|
41
|
+
const maxRem = maxSize / 16;
|
|
42
|
+
const interceptRem = intercept / 16;
|
|
43
|
+
const slopeVw = slope * 100;
|
|
44
|
+
|
|
45
|
+
// Format values
|
|
46
|
+
const minStr = formatNumber(minRem) + "rem";
|
|
47
|
+
const maxStr = formatNumber(maxRem) + "rem";
|
|
48
|
+
const preferred =
|
|
49
|
+
interceptRem >= 0
|
|
50
|
+
? `${formatNumber(interceptRem)}rem + ${formatNumber(slopeVw)}vw`
|
|
51
|
+
: `${formatNumber(Math.abs(interceptRem))}rem - ${formatNumber(Math.abs(slopeVw))}vw`;
|
|
52
|
+
|
|
53
|
+
return `clamp(${minStr}, ${preferred}, ${maxStr})`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Format a number to 4 significant digits, removing trailing zeros.
|
|
58
|
+
*/
|
|
59
|
+
function formatNumber(num) {
|
|
60
|
+
return parseFloat(num.toPrecision(4)).toString();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// -----------------------------------------------------------------------------
|
|
64
|
+
// Musical Interval Ratios
|
|
65
|
+
// -----------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
// Modular scale ratios based on musical intervals
|
|
68
|
+
const RATIOS = [
|
|
69
|
+
{ value: 1.067, name: "Minor Second" },
|
|
70
|
+
{ value: 1.125, name: "Major Second" },
|
|
71
|
+
{ value: 1.2, name: "Minor Third" },
|
|
72
|
+
{ value: 1.25, name: "Major Third" },
|
|
73
|
+
{ value: 1.333, name: "Perfect Fourth" },
|
|
74
|
+
{ value: 1.414, name: "Augmented Fourth" },
|
|
75
|
+
{ value: 1.5, name: "Perfect Fifth" },
|
|
76
|
+
{ value: 1.618, name: "Golden Ratio" },
|
|
77
|
+
{ value: 1.667, name: "Major Sixth" },
|
|
78
|
+
{ value: 1.778, name: "Minor Seventh" },
|
|
79
|
+
{ value: 1.875, name: "Major Seventh" },
|
|
80
|
+
{ value: 2.0, name: "Octave" },
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get the musical interval name for a ratio value.
|
|
85
|
+
* Returns the value as string if no matching interval found.
|
|
86
|
+
*/
|
|
87
|
+
function getRatioName(value) {
|
|
88
|
+
const ratio = RATIOS.find((r) => r.value === value);
|
|
89
|
+
return ratio ? `${ratio.value} - ${ratio.name}` : String(value);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// -----------------------------------------------------------------------------
|
|
93
|
+
// TUI Helpers
|
|
94
|
+
// -----------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Run an interactive configuration editor.
|
|
98
|
+
* Shows settings as selectable list items with inline value editing.
|
|
99
|
+
*
|
|
100
|
+
* @param {Object} options
|
|
101
|
+
* @param {string} options.title - Display title (e.g., "Text Scale")
|
|
102
|
+
* @param {string} options.command - Command name for comment (e.g., "text")
|
|
103
|
+
* @param {Object} options.defaults - Default configuration values
|
|
104
|
+
* @param {Object} options.scale - Scale mapping { name: step } (e.g., { sm: -1, base: 0 })
|
|
105
|
+
* @param {string} options.varPrefix - CSS variable prefix (e.g., "--text" or "--space")
|
|
106
|
+
* @param {Array} options.fields - Field definitions for the editor
|
|
107
|
+
*/
|
|
108
|
+
export async function runEditor({
|
|
109
|
+
title,
|
|
110
|
+
command,
|
|
111
|
+
defaults,
|
|
112
|
+
scale,
|
|
113
|
+
varPrefix,
|
|
114
|
+
fields,
|
|
115
|
+
}) {
|
|
116
|
+
const config = { ...defaults };
|
|
117
|
+
|
|
118
|
+
// Main interaction loop
|
|
119
|
+
while (true) {
|
|
120
|
+
console.clear();
|
|
121
|
+
console.log(`${title} Configuration\n`);
|
|
122
|
+
|
|
123
|
+
// Build choices: fields show current values, then separator, then actions
|
|
124
|
+
const choices = [
|
|
125
|
+
// Editable fields with current values displayed
|
|
126
|
+
...fields.map((f) => {
|
|
127
|
+
// Show musical interval name for ratio fields
|
|
128
|
+
const displayValue =
|
|
129
|
+
f.type === "ratio"
|
|
130
|
+
? getRatioName(config[f.key])
|
|
131
|
+
: `${config[f.key]}${f.suffix || ""}`;
|
|
132
|
+
return {
|
|
133
|
+
name: f.key,
|
|
134
|
+
message: `${f.label}: ${displayValue}`,
|
|
135
|
+
};
|
|
136
|
+
}),
|
|
137
|
+
// Visual separator (disabled choice)
|
|
138
|
+
{ role: "separator", message: "" },
|
|
139
|
+
// Actions
|
|
140
|
+
{ name: "generate", message: "Generate CSS" },
|
|
141
|
+
{ name: "cancel", message: "Cancel" },
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
const select = new Select({
|
|
145
|
+
name: "action",
|
|
146
|
+
message: "Select a setting to edit",
|
|
147
|
+
choices,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
let action;
|
|
151
|
+
try {
|
|
152
|
+
action = await select.run();
|
|
153
|
+
} catch {
|
|
154
|
+
// Escape pressed on main menu - cancel
|
|
155
|
+
console.log("\nCancelled.");
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (action === "cancel") {
|
|
160
|
+
console.log("\nCancelled.");
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (action === "generate") {
|
|
165
|
+
await outputCSS({ title, command, config, scale, varPrefix, fields });
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Edit a field
|
|
170
|
+
const field = fields.find((f) => f.key === action);
|
|
171
|
+
if (field) {
|
|
172
|
+
try {
|
|
173
|
+
if (field.type === "ratio") {
|
|
174
|
+
// Ratio fields use a select menu with musical intervals
|
|
175
|
+
const ratioSelect = new Select({
|
|
176
|
+
name: "ratio",
|
|
177
|
+
message: field.label,
|
|
178
|
+
choices: RATIOS.map((r) => ({
|
|
179
|
+
name: r.value,
|
|
180
|
+
message: `${r.value} - ${r.name}`,
|
|
181
|
+
})),
|
|
182
|
+
initial: RATIOS.findIndex((r) => r.value === config[field.key]),
|
|
183
|
+
});
|
|
184
|
+
config[field.key] = await ratioSelect.run();
|
|
185
|
+
} else {
|
|
186
|
+
// Number fields use a number prompt
|
|
187
|
+
const prompt = new NumberPrompt({
|
|
188
|
+
name: "value",
|
|
189
|
+
message: `${field.label}${field.suffix || ""}`,
|
|
190
|
+
initial: config[field.key],
|
|
191
|
+
});
|
|
192
|
+
config[field.key] = await prompt.run();
|
|
193
|
+
}
|
|
194
|
+
} catch {
|
|
195
|
+
// Escape pressed while editing - return to main menu (continue loop)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Output the generated CSS variables with settings comment.
|
|
203
|
+
* Also copies the output to the clipboard.
|
|
204
|
+
*/
|
|
205
|
+
async function outputCSS({ title, command, config, scale, varPrefix, fields }) {
|
|
206
|
+
console.clear();
|
|
207
|
+
|
|
208
|
+
// Build comment header
|
|
209
|
+
const outputLines = [
|
|
210
|
+
`/* Fluid ${title} – Generated with: \`npx prewindcss ${command}\``,
|
|
211
|
+
];
|
|
212
|
+
for (const field of fields) {
|
|
213
|
+
// Show musical interval name for ratio fields in comments
|
|
214
|
+
const displayValue =
|
|
215
|
+
field.type === "ratio"
|
|
216
|
+
? getRatioName(config[field.key])
|
|
217
|
+
: `${config[field.key]}${field.suffix || ""}`;
|
|
218
|
+
outputLines.push(` ${field.label}: ${displayValue}`);
|
|
219
|
+
}
|
|
220
|
+
outputLines.push("*/");
|
|
221
|
+
|
|
222
|
+
// Generate CSS variables for each scale step
|
|
223
|
+
for (const [name, step] of Object.entries(scale)) {
|
|
224
|
+
const clamp = calculateClamp(config, step);
|
|
225
|
+
outputLines.push(`${varPrefix}-${name}: ${clamp};`);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const output = outputLines.join("\n");
|
|
229
|
+
|
|
230
|
+
// Print the output
|
|
231
|
+
console.log(output);
|
|
232
|
+
console.log("");
|
|
233
|
+
|
|
234
|
+
// Copy to clipboard
|
|
235
|
+
await copyToClipboard(output);
|
|
236
|
+
console.log("✓ Copied to clipboard!");
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Copy text to the system clipboard.
|
|
241
|
+
* Uses pbcopy on macOS, xclip on Linux, clip on Windows.
|
|
242
|
+
*/
|
|
243
|
+
async function copyToClipboard(text) {
|
|
244
|
+
const { spawn } = await import("child_process");
|
|
245
|
+
const platform = process.platform;
|
|
246
|
+
|
|
247
|
+
let cmd, args;
|
|
248
|
+
if (platform === "darwin") {
|
|
249
|
+
cmd = "pbcopy";
|
|
250
|
+
args = [];
|
|
251
|
+
} else if (platform === "win32") {
|
|
252
|
+
cmd = "clip";
|
|
253
|
+
args = [];
|
|
254
|
+
} else {
|
|
255
|
+
// Linux - try xclip
|
|
256
|
+
cmd = "xclip";
|
|
257
|
+
args = ["-selection", "clipboard"];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return new Promise((resolve, reject) => {
|
|
261
|
+
const proc = spawn(cmd, args);
|
|
262
|
+
proc.stdin.write(text);
|
|
263
|
+
proc.stdin.end();
|
|
264
|
+
proc.on("close", resolve);
|
|
265
|
+
proc.on("error", reject);
|
|
266
|
+
});
|
|
267
|
+
}
|
package/script/space.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Space (Spacing) Scale Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates fluid spacing CSS variables using modular scale.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { runEditor } from "./shared.js";
|
|
8
|
+
|
|
9
|
+
// Scale mapping: name -> step (sm = 0)
|
|
10
|
+
const SCALE = {
|
|
11
|
+
"3xs": -3,
|
|
12
|
+
"2xs": -2,
|
|
13
|
+
xs: -1,
|
|
14
|
+
sm: 0,
|
|
15
|
+
md: 1,
|
|
16
|
+
lg: 2,
|
|
17
|
+
xl: 3,
|
|
18
|
+
"2xl": 4,
|
|
19
|
+
"3xl": 5,
|
|
20
|
+
"4xl": 6,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Default configuration
|
|
24
|
+
const DEFAULTS = {
|
|
25
|
+
minViewport: 320,
|
|
26
|
+
maxViewport: 1600,
|
|
27
|
+
minBase: 12,
|
|
28
|
+
maxBase: 18,
|
|
29
|
+
minRatio: 1.5,
|
|
30
|
+
maxRatio: 1.667,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Field definitions for the editor
|
|
34
|
+
const FIELDS = [
|
|
35
|
+
{ key: "minViewport", label: "Min viewport", suffix: "px" },
|
|
36
|
+
{ key: "maxViewport", label: "Max viewport", suffix: "px" },
|
|
37
|
+
{ key: "minBase", label: "Min sm size", suffix: "px" },
|
|
38
|
+
{ key: "maxBase", label: "Max sm size", suffix: "px" },
|
|
39
|
+
{ key: "minRatio", label: "Min ratio", type: "ratio" },
|
|
40
|
+
{ key: "maxRatio", label: "Max ratio", type: "ratio" },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export function run() {
|
|
44
|
+
runEditor({
|
|
45
|
+
title: "Space Scale",
|
|
46
|
+
command: "space",
|
|
47
|
+
defaults: DEFAULTS,
|
|
48
|
+
scale: SCALE,
|
|
49
|
+
varPrefix: "--space",
|
|
50
|
+
fields: FIELDS,
|
|
51
|
+
});
|
|
52
|
+
}
|
package/script/text.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text (Typography) Scale Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates fluid typography CSS variables using modular scale.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { runEditor } from "./shared.js";
|
|
8
|
+
|
|
9
|
+
// Scale mapping: name -> step (base = 0)
|
|
10
|
+
const SCALE = {
|
|
11
|
+
sm: -1,
|
|
12
|
+
base: 0,
|
|
13
|
+
lg: 1,
|
|
14
|
+
xl: 2,
|
|
15
|
+
"2xl": 3,
|
|
16
|
+
"3xl": 4,
|
|
17
|
+
"4xl": 5,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Default configuration
|
|
21
|
+
const DEFAULTS = {
|
|
22
|
+
minViewport: 320,
|
|
23
|
+
maxViewport: 1600,
|
|
24
|
+
minBase: 14,
|
|
25
|
+
maxBase: 18,
|
|
26
|
+
minRatio: 1.25,
|
|
27
|
+
maxRatio: 1.414,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Field definitions for the editor
|
|
31
|
+
const FIELDS = [
|
|
32
|
+
{ key: "minViewport", label: "Min viewport", suffix: "px" },
|
|
33
|
+
{ key: "maxViewport", label: "Max viewport", suffix: "px" },
|
|
34
|
+
{ key: "minBase", label: "Min base size", suffix: "px" },
|
|
35
|
+
{ key: "maxBase", label: "Max base size", suffix: "px" },
|
|
36
|
+
{ key: "minRatio", label: "Min ratio", type: "ratio" },
|
|
37
|
+
{ key: "maxRatio", label: "Max ratio", type: "ratio" },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
export function run() {
|
|
41
|
+
runEditor({
|
|
42
|
+
title: "Text Scale",
|
|
43
|
+
command: "text",
|
|
44
|
+
defaults: DEFAULTS,
|
|
45
|
+
scale: SCALE,
|
|
46
|
+
varPrefix: "--text",
|
|
47
|
+
fields: FIELDS,
|
|
48
|
+
});
|
|
49
|
+
}
|
package/theme.css
CHANGED
|
@@ -57,30 +57,23 @@
|
|
|
57
57
|
|
|
58
58
|
/* Shadow */
|
|
59
59
|
--shadow: 0 4px 4px 1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.25);
|
|
60
|
-
--shadow-sm:
|
|
61
|
-
|
|
60
|
+
--shadow-sm:
|
|
61
|
+
0 2px 3px -0.5px rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
62
|
+
--shadow-lg:
|
|
63
|
+
0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
62
64
|
|
|
63
65
|
/* Width Constraints */
|
|
64
66
|
--max-w-text: 80ch;
|
|
65
67
|
--max-w-form: 40rem;
|
|
66
68
|
|
|
67
|
-
/*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
--ui-field-bg: var(--white);
|
|
76
|
-
--ui-field-bg-disabled: var(--lighter);
|
|
77
|
-
--ui-field-placeholder-color: var(--midtone);
|
|
78
|
-
--ui-field-value-color: var(--dark);
|
|
79
|
-
--ui-field-label-color: var(--midtone);
|
|
80
|
-
--ui-field-value-color-disabled: var(--light);
|
|
81
|
-
--ui-field-icon-width: 1rem;
|
|
82
|
-
|
|
83
|
-
/* Fluid Text and Space (use [NPX command] to update these values) */
|
|
69
|
+
/* Fluid Text Scale – Generated with: `npx prewindcss text`
|
|
70
|
+
Min viewport: 320px
|
|
71
|
+
Max viewport: 1600px
|
|
72
|
+
Min base size: 14px
|
|
73
|
+
Max base size: 18px
|
|
74
|
+
Min ratio: 1.25 - Major Third
|
|
75
|
+
Max ratio: 1.414 - Augmented Fourth
|
|
76
|
+
*/
|
|
84
77
|
--text-sm: clamp(0.7rem, 0.6761rem + 0.1195vw, 0.7956rem);
|
|
85
78
|
--text-base: clamp(0.875rem, 0.8125rem + 0.3125vw, 1.125rem);
|
|
86
79
|
--text-lg: clamp(1.094rem, 0.9695rem + 0.6212vw, 1.591rem);
|
|
@@ -89,14 +82,22 @@
|
|
|
89
82
|
--text-3xl: clamp(2.136rem, 1.546rem + 2.951vw, 4.497rem);
|
|
90
83
|
--text-4xl: clamp(2.67rem, 1.748rem + 4.611vw, 6.359rem);
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
--space-
|
|
101
|
-
--space-
|
|
85
|
+
/* Fluid Space Scale – Generated with: `npx prewindcss space`
|
|
86
|
+
Min viewport: 320px
|
|
87
|
+
Max viewport: 1600px
|
|
88
|
+
Min sm size: 12px
|
|
89
|
+
Max sm size: 18px
|
|
90
|
+
Min ratio: 1.333 - Perfect Fourth
|
|
91
|
+
Max ratio: 1.667 - Major Sixth
|
|
92
|
+
*/
|
|
93
|
+
--space-3xs: clamp(0.3166rem, 0.3351rem + -0.09224vw, 0.2429rem);
|
|
94
|
+
--space-2xs: clamp(0.4221rem, 0.4264rem + -0.02156vw, 0.4048rem);
|
|
95
|
+
--space-xs: clamp(0.5626rem, 0.5346rem + 0.1403vw, 0.6749rem);
|
|
96
|
+
--space-sm: clamp(0.75rem, 0.6563rem + 0.4688vw, 1.125rem);
|
|
97
|
+
--space-md: clamp(0.9997rem, 0.7808rem + 1.095vw, 1.875rem);
|
|
98
|
+
--space-lg: clamp(1.333rem, 0.8843rem + 2.242vw, 3.126rem);
|
|
99
|
+
--space-xl: clamp(1.776rem, 0.9177rem + 4.294vw, 5.211rem);
|
|
100
|
+
--space-2xl: clamp(2.368rem, 0.7881rem + 7.899vw, 8.688rem);
|
|
101
|
+
--space-3xl: clamp(3.157rem, 0.3252rem + 14.16vw, 14.48rem);
|
|
102
|
+
--space-4xl: clamp(4.208rem, 0.7758rem - 24.92vw, 24.14rem);
|
|
102
103
|
}
|