clampography 2.0.0-beta.1 → 2.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clampography",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "Fluid typography system based on CSS clamp() with optional themes and extra styles. A feature-rich alternative to Tailwind CSS Typography plugin.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/base.js CHANGED
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Base typography and reset styles converted from base.css
2
+ * Base typography and layout styles (structure only, no colors).
3
+ * Converted from base.css.
3
4
  */
4
5
  export default {
5
- // Global CSS Variables
6
+ // Global CSS Variables (Spacing & Fonts)
6
7
  "@layer base": {
7
8
  ":root": {
8
9
  "--spacing-sm": "clamp(0.75rem, 0.5625rem + 0.9375vw, 1.25rem)",
@@ -17,7 +18,7 @@ export default {
17
18
  },
18
19
  },
19
20
 
20
- // Typography & Resets
21
+ // Body Structure
21
22
  "body": {
22
23
  "font-family": "var(--font-family-base)",
23
24
  "font-size": "clamp(1rem, 0.95rem + 0.25vw, 1.125rem)",
@@ -28,6 +29,7 @@ export default {
28
29
  "text-wrap": "pretty",
29
30
  },
30
31
 
32
+ // Headings Structure
31
33
  ":where(h1, h2, h3, h4, h5, h6)": {
32
34
  "font-weight": "700",
33
35
  "scroll-margin-top": "var(--scroll-offset)",
@@ -54,6 +56,7 @@ export default {
54
56
  "margin-bottom": "var(--spacing-xs)",
55
57
  },
56
58
 
59
+ // Links
57
60
  "a": {
58
61
  "text-decoration-line": "underline",
59
62
  "text-decoration-thickness": "0.0625em",
@@ -66,6 +69,7 @@ export default {
66
69
  "text-decoration": "none",
67
70
  },
68
71
 
72
+ // Lists & Menus
69
73
  "menu": {
70
74
  "list-style": "none",
71
75
  "margin-bottom": "var(--spacing-md)",
@@ -98,6 +102,7 @@ export default {
98
102
  "margin-top": "0",
99
103
  },
100
104
 
105
+ // Inline elements
101
106
  ":where(strong, b)": {
102
107
  "font-weight": "700",
103
108
  },
@@ -179,6 +184,7 @@ export default {
179
184
  "font-variant-numeric": "tabular-nums",
180
185
  },
181
186
 
187
+ // Blockquotes
182
188
  "blockquote": {
183
189
  "margin-top": "0",
184
190
  "margin-bottom": "0",
@@ -195,6 +201,7 @@ export default {
195
201
  "font-style": "inherit",
196
202
  },
197
203
 
204
+ // Lists
198
205
  ":where(ul, ol)": {
199
206
  "list-style": "none",
200
207
  "margin-bottom": "0",
@@ -222,7 +229,6 @@ export default {
222
229
  "top": "calc(0.875em - 0.1875em)",
223
230
  "width": "0.375em",
224
231
  "height": "0.375em",
225
- "background-color": "currentColor",
226
232
  "border-radius": "50%",
227
233
  },
228
234
 
@@ -243,7 +249,6 @@ export default {
243
249
  "width": "1.75em",
244
250
  "text-align": "right",
245
251
  "font-weight": "600",
246
- "color": "currentColor",
247
252
  },
248
253
 
249
254
  ":where(ul, ol) :where(ul, ol)": {
@@ -281,6 +286,7 @@ export default {
281
286
  "margin-bottom": "0",
282
287
  },
283
288
 
289
+ // Pre / Code
284
290
  "pre": {
285
291
  "margin-top": "var(--spacing-md)",
286
292
  "margin-bottom": "var(--spacing-md)",
@@ -293,10 +299,10 @@ export default {
293
299
  "pre code": {
294
300
  "font-size": "inherit",
295
301
  "padding": "0",
296
- "background": "none",
297
302
  "border-radius": "0",
298
303
  },
299
304
 
305
+ // Fieldset & Form
300
306
  "fieldset": {
301
307
  "margin-top": "var(--spacing-md)",
302
308
  "margin-bottom": "var(--spacing-md)",
@@ -319,6 +325,7 @@ export default {
319
325
  "vertical-align": "middle",
320
326
  },
321
327
 
328
+ // Media
322
329
  ":where(img, video)": {
323
330
  "max-width": "100%",
324
331
  "height": "auto",
@@ -337,6 +344,7 @@ export default {
337
344
  "line-height": "1.5",
338
345
  },
339
346
 
347
+ // Tables
340
348
  "table": {
341
349
  "width": "100%",
342
350
  "margin-top": "0",
@@ -371,12 +379,14 @@ export default {
371
379
  "border-top-width": "2px",
372
380
  },
373
381
 
382
+ // Horizontal Rule
374
383
  "hr": {
375
384
  "margin-top": "var(--spacing-xl)",
376
385
  "margin-bottom": "var(--spacing-xl)",
377
386
  "border": "0",
378
387
  },
379
388
 
389
+ // Interactive
380
390
  ":where(:focus, :focus-visible)": {
381
391
  "outline-offset": "2px",
382
392
  },
@@ -400,6 +410,7 @@ export default {
400
410
  "line-height": "inherit",
401
411
  },
402
412
 
413
+ // Resets
403
414
  "ul": {
404
415
  "margin-top": "0",
405
416
  "margin-bottom": "0",
@@ -414,11 +425,6 @@ export default {
414
425
  },
415
426
 
416
427
  "@media print": {
417
- "body": {
418
- "font-size": "12pt",
419
- "line-height": "1.5",
420
- "color": "#000",
421
- },
422
428
  "table": {
423
429
  "break-inside": "avoid",
424
430
  },
package/src/extra.js CHANGED
@@ -1,34 +1,138 @@
1
+ /**
2
+ * Extra opinionated styles and coloring.
3
+ * Applies colors to the structural base elements.
4
+ */
1
5
  export default {
6
+ // --- Basic Coloring (Applying theme variables) ---
7
+
8
+ "body": {
9
+ "background-color": "var(--clampography-background)",
10
+ "color": "var(--clampography-text)",
11
+ },
12
+
13
+ ":where(h1, h2, h3, h4, h5, h6)": {
14
+ "color": "var(--clampography-heading)",
15
+ },
16
+
17
+ "a": {
18
+ "color": "var(--clampography-link)",
19
+ },
20
+
21
+ // Lists
22
+ "ul > li::before": {
23
+ "background-color": "var(--clampography-primary)", // Bullet points
24
+ },
25
+
26
+ "ol > li::before": {
27
+ "color": "var(--clampography-secondary)", // Numbers
28
+ },
29
+
30
+ // Inline Code
31
+ ":where(code, kbd, samp)": {
32
+ "background-color": "var(--clampography-surface)",
33
+ "color": "var(--clampography-heading)",
34
+ "border": "1px solid var(--clampography-border)",
35
+ "border-radius": "0.25rem",
36
+ },
37
+
38
+ // Preformatted Code Blocks
39
+ "pre": {
40
+ "background-color": "var(--clampography-surface)",
41
+ "border": "1px solid var(--clampography-border)",
42
+ "border-radius": "0.375rem",
43
+ "padding": "1rem",
44
+ },
45
+
46
+ // Tables
47
+ "th": {
48
+ "color": "var(--clampography-heading)",
49
+ },
50
+
51
+ "th, td": {
52
+ "border-bottom": "1px solid var(--clampography-border)",
53
+ },
54
+
55
+ "thead th": {
56
+ "border-bottom-width": "2px",
57
+ },
58
+
59
+ // Captions & Muted text
60
+ "caption, figcaption, .muted": {
61
+ "color": "var(--clampography-muted)",
62
+ },
63
+
64
+ // Horizontal Rule (Thematic)
2
65
  "hr": {
3
66
  "height": "1px",
4
67
  "border-width": "0",
5
- "margin-top": "3rem", /* my-12 (12 * 0.25rem) */
6
- "margin-bottom": "3rem", /* my-12 */
7
- "background-color": "var(--clampography-secondary)",
68
+ "margin-top": "3rem",
69
+ "margin-bottom": "3rem",
70
+ "background-color": "var(--clampography-border)",
8
71
  },
9
72
 
73
+ // --- Opinionated Extras ---
74
+
75
+ // Styled Blockquote
10
76
  "blockquote": {
11
77
  "border-left-width": "4px",
12
- "border-color": "var(--clampography-primary)",
13
- "padding-left": "1rem", /* pl-4 */
14
- "padding-top": "0.5rem", /* py-2 */
15
- "padding-bottom": "0.5rem", /* py-2 */
16
- "padding-right": "0.5rem", /* pr-2 */
78
+ "border-left-color": "var(--clampography-primary)",
79
+ "background-color": "var(--clampography-surface)",
80
+ "padding": "1rem",
81
+ "border-radius": "0.25rem",
82
+ "font-style": "italic",
83
+ "color": "var(--clampography-heading)",
17
84
  },
18
85
 
86
+ // Styled Links (Enhanced)
19
87
  "a": {
20
- "color": "var(--clampography-link)",
21
- "font-weight": "700", /* font-bold */
22
- "letter-spacing": "0.025em", /* tracking-wide */
88
+ "font-weight": "700",
89
+ "letter-spacing": "0.025em",
23
90
  "text-decoration-line": "underline",
24
- "text-decoration-thickness": "2px", /* decoration-2 */
25
- "text-underline-offset": "4px", /* underline-offset-4 */
91
+ "text-decoration-thickness": "2px",
92
+ "text-underline-offset": "4px",
26
93
  "transition-property": "color, text-decoration-color",
27
- "transition-duration": "150ms", /* duration-150 */
94
+ "transition-duration": "150ms",
28
95
  },
29
96
 
30
97
  "a:hover": {
31
- // Używamy zmiennej zdefiniowanej w themes.js (bez prefixu --color-)
32
98
  "text-decoration-color": "var(--clampography-primary)",
33
99
  },
100
+
101
+ // Mark
102
+ "mark": {
103
+ "background-color": "var(--clampography-primary)",
104
+ "color": "var(--clampography-background)",
105
+ },
106
+
107
+ // Deleted Text
108
+ "del": {
109
+ "text-decoration-color": "var(--clampography-secondary)",
110
+ "text-decoration-thickness": "2px",
111
+ },
112
+
113
+ // Fieldset
114
+ "fieldset": {
115
+ "border": "1px solid var(--clampography-border)",
116
+ "border-radius": "0.375rem",
117
+ },
118
+
119
+ "legend": {
120
+ "color": "var(--clampography-heading)",
121
+ },
122
+
123
+ // Details
124
+ "details": {
125
+ "border": "1px solid var(--clampography-border)",
126
+ "border-radius": "0.375rem",
127
+ "padding": "0.5rem",
128
+ },
129
+
130
+ "summary": {
131
+ "color": "var(--clampography-heading)",
132
+ },
133
+
134
+ "details[open] > summary": {
135
+ "border-bottom": "1px solid var(--clampography-border)",
136
+ "padding-bottom": "0.5rem",
137
+ },
34
138
  };
@@ -33,7 +33,11 @@ export default plugin.withOptions((options = {}) => {
33
33
  // Helper to map simplified keys to full CSS vars (optional convenience)
34
34
  const keyMap = {
35
35
  "background": "--clampography-background",
36
+ "surface": "--clampography-surface",
37
+ "border": "--clampography-border",
38
+ "heading": "--clampography-heading",
36
39
  "text": "--clampography-text",
40
+ "muted": "--clampography-muted",
37
41
  "link": "--clampography-link",
38
42
  "primary": "--clampography-primary",
39
43
  "secondary": "--clampography-secondary",
package/src/themes.js CHANGED
@@ -1,28 +1,44 @@
1
1
  export const themes = {
2
2
  light: {
3
3
  "--clampography-background": "#ffffff",
4
- "--clampography-text": "#1f2937",
4
+ "--clampography-surface": "#f3f4f6",
5
+ "--clampography-border": "#e5e7eb",
6
+ "--clampography-heading": "#111827",
7
+ "--clampography-text": "#374151",
8
+ "--clampography-muted": "#6b7280",
5
9
  "--clampography-link": "#2563eb",
6
10
  "--clampography-primary": "#3b82f6",
7
11
  "--clampography-secondary": "#9333ea",
8
12
  },
9
13
  dark: {
10
14
  "--clampography-background": "#0f172a",
11
- "--clampography-text": "#f3f4f6",
15
+ "--clampography-surface": "#1e293b",
16
+ "--clampography-border": "#334155",
17
+ "--clampography-heading": "#f8fafc",
18
+ "--clampography-text": "#cbd5e1",
19
+ "--clampography-muted": "#94a3b8",
12
20
  "--clampography-link": "#60a5fa",
13
21
  "--clampography-primary": "#3b82f6",
14
22
  "--clampography-secondary": "#a855f7",
15
23
  },
16
24
  retro: {
17
25
  "--clampography-background": "#ece3ca",
18
- "--clampography-text": "#2c2420",
26
+ "--clampography-surface": "#e0d6b6",
27
+ "--clampography-border": "#cbbd99",
28
+ "--clampography-heading": "#2c2420",
29
+ "--clampography-text": "#4a3b32",
30
+ "--clampography-muted": "#756354",
19
31
  "--clampography-link": "#d97757",
20
32
  "--clampography-primary": "#e45f2b",
21
33
  "--clampography-secondary": "#f6c342",
22
34
  },
23
35
  cyberpunk: {
24
36
  "--clampography-background": "#000b1e",
37
+ "--clampography-surface": "#051630",
38
+ "--clampography-border": "#0f3661",
39
+ "--clampography-heading": "#ffffff",
25
40
  "--clampography-text": "#00f0ff",
41
+ "--clampography-muted": "#008f99",
26
42
  "--clampography-link": "#ff0099",
27
43
  "--clampography-primary": "#fcee0a",
28
44
  "--clampography-secondary": "#05ffa1",