tailwind-clamp 4.0.2 → 4.0.4

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
@@ -9,7 +9,7 @@ The plugin is based on the formula presented in this [article](https://chriskirk
9
9
  - Clamp values between a min and max viewport width, making it grow / shrink with the viewport.
10
10
  - Possibility to use small to large, large to small, negative to positive, positive to negative and negative to negative values. (Negative values only work on properties that allow them, e.g. `margin`)
11
11
  - Supports `px`, `rem` and `em` units.
12
- - Support `text` values with multiple properties (`fontSize`, `lineHeight`, `letterSpacing`). If `lineHeight` is definded as a unitless number or a `calc()` function, the resulting value is calculated and converted to the `fontSize` unit.
12
+ - Supports `text` values with multiple properties (`fontSize`, `lineHeight`, `letterSpacing`). If `lineHeight` is definded as a unitless number or a `calc()` function, the resulting value is calculated and converted to the `fontSize` unit.
13
13
  - Supports using Tailwind CSS theme values, arbitrary values or a combination.
14
14
 
15
15
  ## Requirements
@@ -21,7 +21,7 @@ The current version of the plugin is designed to be used with Tailwind version 4
21
21
  Install the plugin from npm:
22
22
 
23
23
  ```sh
24
- npm install nicolas-cusan/tailwind-clamp
24
+ npm i tailwind-clamp
25
25
  ```
26
26
 
27
27
  Add the plugin in your main CSS file:
@@ -37,16 +37,16 @@ The plugin allows two configuration options:
37
37
 
38
38
  | Name | Type | Description | Default value |
39
39
  | ---------------------- | ---------- | ------------------------------------- | ------------- |
40
- | **`minViewportWidth`** | `{string}` | Viewport size where the clamp starts. | `375` |
41
- | **`maxViewportWidth`** | `{string}` | Viewport size where the clamp end. | `1440` |
40
+ | **`minViewportWidth`** | `{string}` | Viewport size where the clamp starts. | `23.4375rem` |
41
+ | **`maxViewportWidth`** | `{string}` | Viewport size where the clamp end. | `90rem` |
42
42
 
43
43
  Value should be a css length (`px`, `rem`, `em`). The unit for both options need to match.
44
44
 
45
45
  ```css
46
- @import 'tailwindcss';
46
+ @import "tailwindcss";
47
47
  @plugin "tailwind-clamp" {
48
- minViewportWidth: 23rem,
49
- maxViewportWidth: 90rem
48
+ minViewportWidth: 25rem,
49
+ maxViewportWidth: 80rem
50
50
  };
51
51
  ```
52
52
 
@@ -63,8 +63,8 @@ clamp-[<property>,<start>,<end>,[minViewportWidth,maxViewportWidth]]
63
63
  - `property`: Property that the value should be applied to. See a list of all supported properties below.
64
64
  - `start`: Value at `minViewportWidth` viewport size. It can be a key from your Tailwind CSS config file or a a css length (`px`, `rem`, `em`), the unit will need to match `end`.
65
65
  - `end`: Value at `maxViewportWidth` viewport size. It can be a key from your Tailwind CSS config file or a css length (`px`, `rem`, `em`), the unit will need to match `start`.
66
- - `[minViewportWidth=375]`: Viewport size, where the clamp starts, defaults to `23.4375rem` (`375px`). It can be a breakpoint name from your theme or a css length (`px`, `rem`, `em`), the unit will need to match `maxViewportWidth` and be smaller than `maxViewportWidth`.
67
- - `[maxViewportWidth=1440]`: Viewport size, where the clamp stops, defaults to `90rem` (`1440`). It can be a breakpoint name from your theme or a css length (`px`, `rem`, `em`), the unit will need to match `minViewportWidth` and be be larger than `minViewportWidth`.
66
+ - `[minViewportWidth=23.4375rem]`: Viewport size, where the clamp starts, defaults to `23.4375rem` (`375px`). It can be a breakpoint name from your theme or a css length (`px`, `rem`, `em`), the unit will need to match `maxViewportWidth` and be smaller than `maxViewportWidth`.
67
+ - `[maxViewportWidth=90rem]`: Viewport size, where the clamp stops, defaults to `90rem` (`1440px`). It can be a breakpoint name from your theme or a css length (`px`, `rem`, `em`), the unit will need to match `minViewportWidth` and be be larger than `minViewportWidth`.
68
68
 
69
69
  ### Examples
70
70
 
@@ -88,13 +88,10 @@ clamp-[<property>,<start>,<end>,[minViewportWidth,maxViewportWidth]]
88
88
  - `w`
89
89
  - `h`
90
90
  - `size`
91
- - `min-w`
92
- - `min-h`
93
- - `max-w`
94
- - `max-h`
91
+ - `min-w` and `min-h`
92
+ - `max-w` and `max-h`
95
93
  - `rounded` including `rounded-s`, `rounded-ss`, `rounded-se`, `rounded-e`, `rounded-ee`, `rounded-es`, `rounded-t`, `rounded-r`, `rounded-b`, `rounded-l`, `rounded-tl`, `rounded-tr`, `rounded-bl`, `rounded-br`.
96
- - `translate-x`
97
- - `translate-y`
94
+ - `translate-x` and `translate-y`
98
95
  - `text-stroke`
99
96
  - `stroke`
100
97
  - `leading`