clampography 2.0.0-beta.3 → 2.0.0-beta.30

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/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Dawid Wąsowski
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dawid Wąsowski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,42 +1,46 @@
1
1
  # 🙌 Clampography
2
2
 
3
- **Clampography** is a pure CSS typography system that uses the
4
- [clamp()](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/clamp)
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
- [94% global browser support](https://caniuse.com/css-math-functions), it works
9
- on nearly all modern devices.
10
-
11
- - **No default styling:** No colors, borders, transforms, or decorations.
12
- - **Structure only:** Manages size, spacing, weight, and font-family.
3
+ > **WARNING**: Beta 2.0.0 is in development.
4
+
5
+ **Clampography** is a CSS typography system designed mainly for blogs and
6
+ documentation sites. It uses the CSS `clamp()` function for fluid, responsive
7
+ text scaling. Built as a [Tailwind CSS](https://tailwindcss.com/) plugin, it
8
+ delivers production-ready typography with optional theming support. Basic
9
+ features work in about 95% of browsers using standard CSS
10
+ [clamp()](https://caniuse.com/css-math-functions). When you enable Themes with
11
+ [oklch()](https://caniuse.com/wf-oklab) colors, browser support decreases to
12
+ about 92%.
13
+
14
+ - **Typography first:** Fluid, responsive text scaling without any styling
15
+ - **Structure only:** Manages size, spacing, weight, and font-family
13
16
  - **Smart scaling:** Contextual elements use `em` (relative), blocks use
14
- `clamp()` (fluid).
17
+ `clamp()` (fluid)
18
+ - **Optional theming:** Built-in light/dark themes or create your own with
19
+ [OKLCH](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/oklch)
20
+ colors
15
21
 
16
22
  ## The purpose
17
23
 
18
24
  [CSS resets](https://en.wikipedia.org/wiki/Reset_style_sheet) like
19
25
  [Tailwind's Preflight](https://tailwindcss.com/docs/preflight) remove all
20
26
  browser typography defaults, leaving you with unstyled text. **Clampography**
21
- delivers production-ready text scaling that responds to viewport changes
22
- automatically, while leaving all aesthetic choices to you.
23
-
24
- Visit the temporary [demo page](https://next.dav.one/clampography/) to see how
25
- it looks.
27
+ delivers production-ready typography that responds to
28
+ [viewport](https://en.wikipedia.org/wiki/Viewport) changes automatically, while
29
+ leaving all aesthetic choices to you. Add themes only if you need them.
26
30
 
27
31
  ## Requirements
28
32
 
29
- Use [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), or similar
30
- build tool for CSS bundling. Popular frameworks like
31
- [Astro](https://astro.build/), [Next.js](https://nextjs.org/),
32
- [Remix](https://remix.run/), and
33
- [SvelteKit](https://svelte.dev/docs/kit/introduction) include CSS bundling by
34
- default and work seamlessly with **Clampography**. Without a build tool, native
35
- CSS `@import` combined with `@layer` has about 91% browser coverage and only
36
- works in browsers released since early 2022.
33
+ - **[Tailwind CSS](https://tailwindcss.com/)** v4
34
+ - A build tool like [Vite](https://vitejs.dev/),
35
+ [Webpack](https://webpack.js.org/), or framework with CSS bundling like
36
+ [Astro](https://astro.build/), [Next.js](https://nextjs.org/),
37
+ [Remix](https://remix.run/),
38
+ [SvelteKit](https://svelte.dev/docs/kit/introduction)
37
39
 
38
40
  ## Installation
39
41
 
42
+ ### Via Package Manager (Tailwind Plugin)
43
+
40
44
  ```bash
41
45
  # Install with NPM
42
46
  npm install clampography
@@ -51,21 +55,115 @@ bun install clampography
51
55
  deno install npm:clampography
52
56
  ```
53
57
 
54
- ## Usage
58
+
59
+ ## Quick Start
60
+
61
+ ### Typography Only
62
+
63
+ Load just the typography system without any colors:
55
64
 
56
65
  ```css
57
- /* First import Tailwind CSS */
58
66
  @import "tailwindcss";
67
+ @plugin "clampography";
68
+ ```
69
+
70
+ **Result:**
71
+
72
+ - ✅ Fluid typography (headings, paragraphs, lists, etc.)
73
+ - ✅ Responsive spacing system
74
+ - ✅ Structural base styles
75
+ - ❌ No colors, borders, or decorations
76
+
77
+ Use your own color system with Tailwind utilities:
78
+
79
+ ```html
80
+ <div class="bg-white text-gray-900 dark:bg-gray-900 dark:text-white">
81
+ <h1>Fluid Typography</h1>
82
+ <p>Text scales automatically based on viewport size.</p>
83
+ </div>
84
+ ```
59
85
 
60
- /* Then import Clampography */
61
- @import "clampography";
86
+ ### Typography + Built-in Themes (Optional)
62
87
 
63
- /* Then you can override Clampography's base styles */
64
- @layer base {
65
- h1 {
66
- font-size: clamp(2.35rem, 1.95rem + 1.5vw, 4rem);
67
- font-weight: 400;
68
- line-height: 1.15;
69
- }
88
+ Add automatic light/dark theming:
89
+
90
+ ```css
91
+ @import "tailwindcss";
92
+ @plugin "clampography" {
93
+ themes: all; /* Loads all built-in themes */
70
94
  }
71
95
  ```
96
+
97
+ **What this adds:**
98
+
99
+ - Automatic light/dark switching based on `prefers-color-scheme`
100
+ - Manual theme switching via `data-theme` attribute
101
+ - Tailwind utilities like `bg-clampography-primary`
102
+
103
+ ```html
104
+ <div class="bg-clampography-background text-clampography-text">
105
+ <h1 class="text-clampography-heading">Hello World</h1>
106
+ <button class="bg-clampography-primary">Click Me</button>
107
+ </div>
108
+
109
+ <!-- Manual theme switching -->
110
+ <body data-theme="dark">...</body>
111
+ ```
112
+
113
+ ### Custom Theme (Optional)
114
+
115
+ Create your own theme with OKLCH colors:
116
+
117
+ ```css
118
+ @import "tailwindcss";
119
+ @plugin "clampography" {
120
+ themes: false;
121
+ }
122
+
123
+ @plugin "clampography/theme" {
124
+ name: "brand";
125
+ default: true;
126
+
127
+ primary: "oklch(60% 0.25 270)";
128
+ background: "oklch(99% 0.005 270)";
129
+ text: "oklch(20% 0.02 270)";
130
+ /* Missing colors auto-filled from fallback */
131
+ }
132
+ ```
133
+
134
+ ## Configuration Options
135
+
136
+ ```css
137
+ @plugin "clampography" {
138
+ themes: "all" | "light, dark" | false; /* Load themes (optional) */
139
+ base: true | false; /* Typography styles (default: true) */
140
+ extra: true | false; /* Enhanced styling (default: false) */
141
+ forms: true | false; /* Styled form elements (default: false) */
142
+ kbd: true | false; /* 3D keyboard key effect on <kbd> (default: false) */
143
+ prefix: "clampography" | false; /* Utility class prefix */
144
+ root: ":root" | "#app"; /* Scope to element */
145
+ logs: true | false; /* Console output */
146
+ }
147
+ ```
148
+
149
+ ## Learn More
150
+
151
+ 📖 **[Complete Usage Guide](docs/usage.md)** - Detailed documentation covering:
152
+
153
+ - Installation (NPM & CDN)
154
+ - Basic configuration options
155
+ - Built-in themes
156
+ - Creating custom themes
157
+ - Scoped themes for widgets
158
+ - Form styles & Tailwind utilities
159
+ - Troubleshooting
160
+
161
+ ## Inspirations
162
+
163
+ Two main inspirations behind this project were:
164
+ - **daisyUI** created by [Pouya Saadeghi](https://saadeghi.com/)
165
+ - The official **Typography** plugin for Tailwind CSS: [tailwindcss-typography](https://github.com/tailwindlabs/tailwindcss-typography)
166
+
167
+ ## License
168
+
169
+ [MIT](LICENSE)