clampography 0.9.6 → 0.9.8

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
@@ -1,22 +1,38 @@
1
1
  # 🙌 Clampography
2
2
 
3
- **Clampography** is a CSS-only alternative to the official
4
- [Tailwind CSS Typography plugin](https://github.com/tailwindlabs/tailwindcss-typography).
5
- Instead of fixed sizes, it uses the CSS
3
+ **Clampography** is a pure CSS typography system that uses the
6
4
  [clamp()](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/clamp)
7
- function to create fluid typography that adapts to any screen. With
5
+ function for fluid, responsive text scaling. It's designed as an alternative to
6
+ [@tailwindcss/typography](https://github.com/tailwindlabs/tailwindcss-typography),
7
+ but works with or without [Tailwind CSS](https://tailwindcss.com/). With
8
8
  [94% global browser support](https://caniuse.com/css-math-functions), it works
9
- on nearly all devices.
10
-
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.
9
+ on nearly all modern devices.
14
10
 
15
11
  - **No default styling:** No colors, borders, transforms, or decorations.
16
12
  - **Structure only:** Manages size, spacing, weight, and font-family.
17
13
  - **Smart scaling:** Contextual elements use `em` (relative), blocks use
18
14
  `clamp()` (fluid).
19
15
 
16
+ ## The purpose
17
+
18
+ CSS resets like [Tailwind's Preflight](https://tailwindcss.com/docs/preflight)
19
+ remove all browser typography defaults, leaving you with unstyled text.
20
+ **Clampography** delivers production-ready text scaling that responds to
21
+ viewport changes automatically, while leaving all aesthetic choices to you.
22
+ Visit the temporary [demo page](https://next.dav.one/clampography/) to see how
23
+ it looks.
24
+
25
+ ## Requirements
26
+
27
+ Use [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), or similar
28
+ build tool for CSS bundling. Popular frameworks like
29
+ [Astro](https://astro.build/), [Next.js](https://nextjs.org/),
30
+ [Remix](https://remix.run/), and
31
+ [SvelteKit](https://svelte.dev/docs/kit/introduction) include CSS bundling by
32
+ default and work seamlessly with **Clampography**. Without a build tool, native
33
+ CSS `@import` combined with `@layer` has about 91% browser coverage and only
34
+ works in browsers released since early 2022.
35
+
20
36
  ## Installation
21
37
 
22
38
  ```bash
@@ -42,7 +58,7 @@ deno install npm:clampography
42
58
  /* Then import Clampography */
43
59
  @import "clampography";
44
60
 
45
- /* Override default heading styles */
61
+ /* Then you can override Clampography's base styles */
46
62
  @layer base {
47
63
  h1 {
48
64
  font-size: clamp(2.35rem, 1.95rem + 1.5vw, 4rem);
package/clampography.css CHANGED
@@ -97,10 +97,9 @@
97
97
  -------------------------------------------------------------------------- */
98
98
 
99
99
  a {
100
- /* Structural underline - indicates clickability */
101
100
  text-decoration-line: underline;
102
- text-decoration-thickness: 0.0625em; /* 1px at 16px base */
103
- text-underline-offset: 0.15em; /* Space from baseline */
101
+ text-decoration-thickness: 0.0625em;
102
+ text-underline-offset: 0.15em;
104
103
  cursor: pointer;
105
104
  }
106
105
 
@@ -116,7 +115,7 @@
116
115
  menu {
117
116
  list-style: none;
118
117
  margin-bottom: var(--spacing-md);
119
- padding-left: 0; /* No indentation - unlike ul/ol */
118
+ padding-left: 0;
120
119
  }
121
120
 
122
121
  /* Remove custom markers from menu items */
@@ -141,8 +140,8 @@
141
140
  hgroup :where(p) {
142
141
  margin-top: 0;
143
142
  margin-bottom: 0;
144
- font-size: 0.875em; /* Relative to parent context */
145
- font-weight: 400; /* Lighter than heading */
143
+ font-size: 0.875em;
144
+ font-weight: 400;
146
145
  line-height: 1.5;
147
146
  }
148
147
 
@@ -173,7 +172,7 @@
173
172
 
174
173
  /* Contextual sizing - uses 'em' to scale with parent */
175
174
  small {
176
- font-size: 0.875em; /* 87.5% of parent */
175
+ font-size: 0.875em;
177
176
  line-height: 1.5;
178
177
  }
179
178
 
@@ -210,7 +209,6 @@
210
209
  cursor: help;
211
210
  }
212
211
 
213
- /* Editorial marks - semantic text changes */
214
212
  del {
215
213
  text-decoration: line-through;
216
214
  }
@@ -219,12 +217,12 @@
219
217
  text-decoration: underline;
220
218
  }
221
219
 
222
- /* Strikethrough - presentational (not semantic like del) */
220
+ /* Strikethrough */
223
221
  s {
224
222
  text-decoration: line-through;
225
223
  }
226
224
 
227
- /* Underline - presentational (not semantic like ins) */
225
+ /* Underline */
228
226
  u {
229
227
  text-decoration: underline;
230
228
  }
@@ -379,16 +377,13 @@
379
377
  margin-top: var(--spacing-md);
380
378
  margin-bottom: var(--spacing-md);
381
379
  font-family: var(--font-family-mono);
382
- font-size: 0.875em;
383
380
  line-height: 1.6;
384
381
  overflow-x: auto;
385
- /* Padding & background moved to global.css */
386
382
  }
387
383
 
388
384
  /* Code inside pre blocks */
389
385
  pre code {
390
386
  font-size: inherit;
391
- /* Reset inline code styles if any user CSS exists */
392
387
  padding: 0;
393
388
  background: none;
394
389
  border-radius: 0;
@@ -402,7 +397,7 @@
402
397
  margin-top: var(--spacing-md);
403
398
  margin-bottom: var(--spacing-md);
404
399
  padding: var(--spacing-md);
405
- border: 0; /* Remove default border - user adds styling */
400
+ border: 0;
406
401
  }
407
402
 
408
403
  legend {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clampography",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Fluid typography system based on CSS clamp() for Tailwind CSS v4. Alternative to Tailwind CSS Typography plugin.",
5
5
  "main": "clampography.css",
6
6
  "style": "clampography.css",
@@ -36,7 +36,7 @@
36
36
  "type": "git",
37
37
  "url": "https://github.com/Avaray/clampography.git"
38
38
  },
39
- "homepage": "https://dav.one/clampography",
39
+ "homepage": "https://next.dav.one/clampography/",
40
40
  "author": "Dawid Wąsowski",
41
41
  "license": "MIT"
42
42
  }
@@ -1 +1,19 @@
1
+ /* You need daisyUI for this preset. Make sure its colors are accessible. */
2
+
1
3
  @import '../clampography.css';
4
+
5
+ @layer base {
6
+ a {
7
+ @apply text-primary font-bold tracking-wider underline decoration-2 underline-offset-4 transition-colors duration-150;
8
+
9
+ text-decoration-color: color-mix(
10
+ in srgb,
11
+ var(--color-primary) 30%,
12
+ transparent
13
+ );
14
+ }
15
+
16
+ a:hover {
17
+ text-decoration-color: var(--color-primary);
18
+ }
19
+ }