postcss-clampwind 0.0.1 → 0.0.3
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 +8 -8
- package/dist/clampwind.cjs.cjs +1 -12
- package/dist/clampwind.esm.js +1 -4
- package/package.json +1 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# clampwind
|
|
1
|
+
# postcss-clampwind
|
|
2
2
|
|
|
3
3
|
A PostCSS plugin that transforms any two‑argument `clamp()` call into a fully fluid value, seamlessly integrating with Tailwind CSS utilities. Made for Tailwind v4.
|
|
4
4
|
|
|
@@ -26,7 +26,7 @@ The supplied values are used to generate the expression inside the `clamp()` fun
|
|
|
26
26
|
Install the plugin from npm:
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
npm install -D clampwind
|
|
29
|
+
npm install -D postcss-clampwind
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
### PostCSS setup
|
|
@@ -36,7 +36,7 @@ Add the plugin to your `postcss.config.js` file:
|
|
|
36
36
|
```js
|
|
37
37
|
// postcss.config.mjs
|
|
38
38
|
import tailwindcss from "@tailwindcss/postcss"
|
|
39
|
-
import clampwind from "clampwind"
|
|
39
|
+
import clampwind from "postcss-clampwind"
|
|
40
40
|
|
|
41
41
|
export default {
|
|
42
42
|
plugins: [
|
|
@@ -55,7 +55,7 @@ If you are using CommonJS-based build tools like Webpack, you will need to use t
|
|
|
55
55
|
module.exports = {
|
|
56
56
|
plugins: {
|
|
57
57
|
require("@tailwindcss/postcss"),
|
|
58
|
-
require(
|
|
58
|
+
require("postcss-clampwind").default
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
```
|
|
@@ -66,7 +66,7 @@ If you are using Vite, you are probably using Tailwind with `@tailwindcss/vite`.
|
|
|
66
66
|
|
|
67
67
|
```js
|
|
68
68
|
// postcss.config.js
|
|
69
|
-
import clampwind from
|
|
69
|
+
import clampwind from "postcss-clampwind";
|
|
70
70
|
|
|
71
71
|
export default {
|
|
72
72
|
plugins: [
|
|
@@ -187,7 +187,7 @@ This will generate the following css:
|
|
|
187
187
|
|
|
188
188
|
### Clamp from one breakpoint
|
|
189
189
|
|
|
190
|
-
If you want to define a clamp value from a single breakpoint, clampwind will automatically generate the calculation from the defined breakpoint to the smallest or largest breakpoint depending on the direction, for example:
|
|
190
|
+
If you want to define a clamp value from a single breakpoint, postcss-clampwind will automatically generate the calculation from the defined breakpoint to the smallest or largest breakpoint depending on the direction, for example:
|
|
191
191
|
|
|
192
192
|
```html
|
|
193
193
|
<div class="md:text-[clamp(16px,50px)]"></div>
|
|
@@ -273,7 +273,7 @@ But this won't work when using two custom properties directly in the CSS with `@
|
|
|
273
273
|
|
|
274
274
|
### Clamp container queries
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
Postcss-clampwind supports container queries, just by using the normal Tailwind container query syntax, for example:
|
|
277
277
|
|
|
278
278
|
```html
|
|
279
279
|
<div class="@md:text-[clamp(16px,50px)]"></div>
|
|
@@ -291,7 +291,7 @@ This will generate the following css:
|
|
|
291
291
|
|
|
292
292
|
## Configuration
|
|
293
293
|
|
|
294
|
-
Tailwind v4 introduced the new CSS-based configuration and clampwind embraces it.
|
|
294
|
+
Tailwind v4 introduced the new CSS-based configuration and postcss-clampwind embraces it.
|
|
295
295
|
|
|
296
296
|
### Add custom breakpoints
|
|
297
297
|
|
package/dist/clampwind.cjs.cjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/clampwind.js
|
|
@@ -32,7 +22,6 @@ __export(clampwind_exports, {
|
|
|
32
22
|
default: () => clampwind_default
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(clampwind_exports);
|
|
35
|
-
var import_postcss = __toESM(require("postcss"), 1);
|
|
36
25
|
|
|
37
26
|
// src/screens.js
|
|
38
27
|
var defaultScreens = {
|
|
@@ -176,7 +165,7 @@ var clampwind = (opts = {}) => {
|
|
|
176
165
|
postcssPlugin: "clampwind",
|
|
177
166
|
prepare() {
|
|
178
167
|
let rootFontSize = 16;
|
|
179
|
-
let spacingSize = "
|
|
168
|
+
let spacingSize = "0.25rem";
|
|
180
169
|
let customProperties = {};
|
|
181
170
|
let screens = defaultScreens || {};
|
|
182
171
|
let containerScreens = defaultContainerScreens || {};
|
package/dist/clampwind.esm.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// src/clampwind.js
|
|
2
|
-
import postcss from "postcss";
|
|
3
|
-
|
|
4
1
|
// src/screens.js
|
|
5
2
|
var defaultScreens = {
|
|
6
3
|
sm: "40rem",
|
|
@@ -143,7 +140,7 @@ var clampwind = (opts = {}) => {
|
|
|
143
140
|
postcssPlugin: "clampwind",
|
|
144
141
|
prepare() {
|
|
145
142
|
let rootFontSize = 16;
|
|
146
|
-
let spacingSize = "
|
|
143
|
+
let spacingSize = "0.25rem";
|
|
147
144
|
let customProperties = {};
|
|
148
145
|
let screens = defaultScreens || {};
|
|
149
146
|
let containerScreens = defaultContainerScreens || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-clampwind",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "A PostCSS plugin to create fluid clamp values for any Tailwind CSS utility",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -34,9 +34,6 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"esbuild": "^0.25.6"
|
|
36
36
|
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"postcss": "^8.4.39"
|
|
39
|
-
},
|
|
40
37
|
"scripts": {
|
|
41
38
|
"dev": "node scripts/build.js --watch",
|
|
42
39
|
"build": "node scripts/build.js"
|