clampography 0.9.0 → 0.9.2

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 CHANGED
@@ -5,17 +5,12 @@
5
5
  Instead of fixed sizes, it uses the CSS
6
6
  [clamp()](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/clamp)
7
7
  function to create fluid typography that adapts to any screen. With
8
- [94%+ global browser support](https://caniuse.com/css-math-functions), it works
8
+ [94% global browser support](https://caniuse.com/css-math-functions), it works
9
9
  on nearly all devices.
10
10
 
11
- Designed for [Tailwind v4's](https://tailwindcss.com/blog/tailwindcss-v4)
12
- CSS-first system, no JavaScript configuration needed. Best suited for simple
13
- websites like blogs and articles.
14
-
15
- ## Philosophy
16
-
17
- **Clampography** is built on three core principles to match
18
- `@tailwindcss/typography` quality standards while remaining pure CSS:
11
+ Built for [Tailwind v4's](https://tailwindcss.com/blog/tailwindcss-v4) CSS-first
12
+ architecture. Zero JavaScript configuration required. Best suited for blogs,
13
+ documentation, and content-heavy websites.
19
14
 
20
15
  - **No default styling:** No colors, borders, transforms, or decorations.
21
16
  - **Structure only:** Manages size, spacing, weight, and font-family.
package/clampography.css CHANGED
@@ -1,17 +1,4 @@
1
1
  @layer base {
2
- /* ==========================================================================
3
-
4
- CLAMPOGRAPHY
5
-
6
- A fluid typography system matching @tailwindcss/typography standards.
7
-
8
- PHILOSOPHY:
9
- - No default styling (no colors, borders, transforms, decorations)
10
- - Structure only: size, spacing, weight, font-family
11
- - Contextual elements use 'em' (relative), blocks use 'clamp' (fluid)
12
-
13
- ========================================================================== */
14
-
15
2
  /* --------------------------------------------------------------------------
16
3
  ROOT CONFIGURATION
17
4
  -------------------------------------------------------------------------- */
@@ -40,7 +27,6 @@
40
27
 
41
28
  body {
42
29
  font-family: var(--font-family-base);
43
- /* Typography standard: 16px → 18px (not 14px) for optimal readability */
44
30
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
45
31
  line-height: 1.75;
46
32
 
@@ -58,21 +44,19 @@
58
44
  -------------------------------------------------------------------------- */
59
45
 
60
46
  :where(h1, h2, h3, h4, h5, h6) {
61
- font-weight: 600; /* Default weight, individual headings override */
47
+ font-weight: 600;
62
48
  scroll-margin-top: var(--scroll-offset);
63
49
  }
64
50
 
65
51
  h1 {
66
- /* Typography standard: 36px → 48px (matches prose-base → prose-lg) */
67
52
  font-size: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);
68
- line-height: 1.1111; /* Tailwind Typography uses tighter line-height for h1 */
69
- font-weight: 800; /* Typography uses heavier weight for h1 */
53
+ line-height: 1.1111;
54
+ font-weight: 800;
70
55
  margin-top: 0;
71
56
  margin-bottom: var(--spacing-xl);
72
57
  }
73
58
 
74
59
  h2 {
75
- /* Typography standard: 24px → 30px */
76
60
  font-size: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
77
61
  line-height: 1.3333;
78
62
  font-weight: 700;
@@ -81,7 +65,6 @@
81
65
  }
82
66
 
83
67
  h3 {
84
- /* Typography standard: 20px → 24px */
85
68
  font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
86
69
  line-height: 1.6;
87
70
  margin-top: var(--spacing-lg);
@@ -89,7 +72,6 @@
89
72
  }
90
73
 
91
74
  h4 {
92
- /* Typography standard: stays at body size (16px → 18px) */
93
75
  font-size: clamp(1rem, 0.975rem + 0.125vw, 1.125rem);
94
76
  line-height: 1.5;
95
77
  margin-top: var(--spacing-lg);
@@ -97,15 +79,14 @@
97
79
  }
98
80
 
99
81
  h5 {
100
- /* H5/H6 rarely used in prose, but keep them proportional */
101
- font-size: 1rem; /* Fixed at body size, distinguished by weight */
82
+ font-size: 1rem;
102
83
  line-height: 1.5;
103
84
  margin-top: var(--spacing-md);
104
85
  margin-bottom: var(--spacing-xs);
105
86
  }
106
87
 
107
88
  h6 {
108
- font-size: 0.875rem; /* Slightly smaller for hierarchy */
89
+ font-size: 0.875rem;
109
90
  line-height: 1.5;
110
91
  margin-top: var(--spacing-md);
111
92
  margin-bottom: var(--spacing-xs);
@@ -214,7 +195,6 @@
214
195
  margin-top: var(--spacing-lg);
215
196
  margin-bottom: var(--spacing-lg);
216
197
  padding-left: var(--spacing-md);
217
- /* No font-style - let users decide visual treatment */
218
198
  }
219
199
 
220
200
  /* Nested blockquotes - reduced spacing for hierarchy */
@@ -243,32 +223,33 @@
243
223
 
244
224
  li {
245
225
  position: relative;
246
- margin-bottom: var(--spacing-xs);
247
226
  padding-left: 0.375em; /* Space between marker and text */
248
227
  }
249
228
 
250
- /*
251
- * CUSTOM BULLETS (UL)
252
- * Perfectly centered dot relative to the first line of text.
253
- */
229
+ /* Spacing between list items */
230
+ li + li {
231
+ margin-top: var(--spacing-xs);
232
+ }
233
+
234
+ /* Spacing before nested lists */
235
+ li > :where(ul, ol) {
236
+ margin-top: var(--spacing-xs);
237
+ }
238
+
239
+ /* Perfectly centered dot relative to the first line of text */
254
240
  ul > li::before {
255
241
  content: '';
256
242
  position: absolute;
257
- /* Positioning relative to the li padding */
258
243
  left: -1.125em;
259
- /* Vertically aligns with the first line (assuming line-height 1.75) */
260
244
  top: calc(0.875em - 0.1875em);
261
245
  width: 0.375em;
262
246
  height: 0.375em;
263
247
  background-color: currentColor;
264
248
  border-radius: 50%;
265
- opacity: 0.4; /* Subtle visual weight */
249
+ opacity: 0.4;
266
250
  }
267
251
 
268
- /*
269
- * CUSTOM NUMBERS (OL)
270
- * Right-aligned numbers for professional look (e.g. "9." aligns with "10.")
271
- */
252
+ /* Right-aligned numbers for professional look (e.g. "9." aligns with "10.") */
272
253
  ol {
273
254
  counter-reset: list-counter;
274
255
  }
@@ -280,18 +261,17 @@
280
261
  ol > li::before {
281
262
  content: counter(list-counter) '.';
282
263
  position: absolute;
283
- left: -2.5em; /* More space for numbers */
284
- width: 1.75em; /* Fixed width container for alignment */
264
+ left: -2.5em;
265
+ width: 1.75em;
285
266
  text-align: right;
286
- font-weight: 600; /* Make numbers stand out structurally */
267
+ font-weight: 600;
287
268
  color: currentColor;
288
- opacity: 0.6; /* Slightly lighter than text */
269
+ opacity: 0.6;
289
270
  }
290
271
 
291
- /* Nested lists spacing */
272
+ /* Nested lists - indentation only, spacing handled by li rules above */
292
273
  :where(ul, ol) :where(ul, ol) {
293
- margin-top: 0.5rem;
294
- margin-bottom: 0.5rem;
274
+ margin-bottom: 0; /* Parent li spacing already handles this */
295
275
  padding-left: var(--spacing-md);
296
276
  }
297
277
 
@@ -390,7 +370,6 @@
390
370
  }
391
371
 
392
372
  figcaption {
393
- margin-top: var(--spacing-xs);
394
373
  font-size: 0.875em;
395
374
  line-height: 1.5;
396
375
  }
@@ -453,7 +432,6 @@
453
432
  margin-top: var(--spacing-xl);
454
433
  margin-bottom: var(--spacing-xl);
455
434
  border: 0;
456
- /* Border style moved to global.css */
457
435
  }
458
436
 
459
437
  /* --------------------------------------------------------------------------
@@ -472,10 +450,8 @@
472
450
  summary {
473
451
  cursor: pointer;
474
452
  font-weight: 600;
475
- margin-bottom: var(--spacing-xs);
476
453
  }
477
454
 
478
- /* Dialog element - semantic modal */
479
455
  dialog {
480
456
  font-size: inherit;
481
457
  line-height: inherit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clampography",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Fluid typography system based on CSS clamp() for Tailwind CSS v4",
5
5
  "main": "clampography.css",
6
6
  "style": "clampography.css",
@@ -21,6 +21,7 @@
21
21
  "style",
22
22
  "tailwind",
23
23
  "tailwind-css",
24
+ "tailwind-plugin",
24
25
  "tailwindcss",
25
26
  "text",
26
27
  "typography"