tailwind-clamp 2.2.0 → 2.2.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/README.md CHANGED
@@ -127,7 +127,7 @@ export default {
127
127
  | **`[options.maxViewportWidth]`** | `{number}` | Viewport size, where the clamp stops. | `1440` |
128
128
  | **`[options.unit]`** | `{'px'\|'rem'\|'em'}` | Unit that should be used in the css value. | `rem` |
129
129
 
130
- Al values are expected in pixels and will be converted to `[options.unit]`.
130
+ All values are expected in pixels and will be converted to `[options.unit]`.
131
131
 
132
132
  ## Supported properties
133
133
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-clamp",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Tailwind CSS plugin to use CSS clamp in your projects",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/clamp.js CHANGED
@@ -6,7 +6,7 @@ export const clamp = (
6
6
  _minvw = { number: 375, unit: 'px' },
7
7
  _maxvw = { number: 1440, unit: 'px' }
8
8
  ) => {
9
- const unit = _start.unit;
9
+ const unit = _start.unit === 'zero' ? _end.unit : _start.unit;
10
10
  const isPx = unit === 'px';
11
11
 
12
12
  let start = _start.number;
package/src/index.js CHANGED
@@ -2,14 +2,14 @@ import plugin from 'tailwindcss/plugin';
2
2
  import { resolveProperty } from './resolve-property.js';
3
3
  import { log } from './log.js';
4
4
  import { parseValue, parseFontSizeValue, checkValues } from './parse-value.js';
5
- import { clamp, clampValue } from './clamp.js';
5
+ import { clamp, clampValue as cv } from './clamp.js';
6
6
 
7
7
  const defaultOptions = {
8
8
  minViewportWidth: 375,
9
9
  maxViewportWidth: 1440,
10
10
  };
11
11
 
12
- export const clampValue = clampValue;
12
+ export const clampValue = cv;
13
13
 
14
14
  export default plugin.withOptions(function (options = defaultOptions) {
15
15
  return function ({ matchUtilities, theme, config }) {