zaravand-ui 4.3.0 → 4.3.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.
@@ -5,19 +5,28 @@ type ApplyScaleOptions = {
5
5
  /**
6
6
  * Sets the `--zui-scale` CSS custom property this library's components
7
7
  * size themselves against (see src/index.css and shared/responsiveScale.ts).
8
- * `scale` is a unitless multiplier of the desktop/Full-HD design size
9
- * `1` (the default when this is never called) renders every component at
10
- * its fixed desktop size; a consuming app that wants this library to
11
- * shrink/grow with the viewport computes and passes a smaller/larger
12
- * number here (or sets the CSS variable itself, e.g. via a `clamp()` on
13
- * `:root` — this function is a convenience over that, same relationship
14
- * `applyTheme` has to hand-writing the theme's CSS variables).
8
+ * `scale` is a CSS length `10px` (the default when this is never
9
+ * called) renders every component at its fixed desktop size; a
10
+ * consuming app that wants this library to shrink/grow with the
11
+ * viewport passes a smaller/larger length here (or sets the CSS
12
+ * variable itself, e.g. via a `clamp()` on `:root` — this function is a
13
+ * convenience over that, same relationship `applyTheme` has to
14
+ * hand-writing the theme's CSS variables). A bare `number` is treated
15
+ * as a `px` value.
16
+ *
17
+ * `--zui-scale` is kept a length rather than a unitless ratio because a
18
+ * bare CSS <number> can't be derived from a viewport-relative unit like
19
+ * `vw` without dividing it by another length inside `calc()` — and
20
+ * dividing two dimensioned values is exactly the construct Firefox
21
+ * silently drops the whole declaration for. A length can be set with a
22
+ * plain `clamp()` of `px`/`vw` values, no calc() division needed, the
23
+ * same shape as a typical root `font-size` clamp.
15
24
  *
16
25
  * Deliberately independent of the host app's own root `font-size`/`rem`
17
26
  * scaling: `rem` always resolves against the document's <html> element,
18
27
  * so it can't be scoped to just this library's components, which is why
19
28
  * this library stopped reading it.
20
29
  */
21
- declare function applyScale(scale: number, options?: ApplyScaleOptions): number;
30
+ declare function applyScale(scale: number | string, options?: ApplyScaleOptions): string;
22
31
  export type { ApplyScaleOptions };
23
32
  export { applyScale, ZUI_SCALE_CSS_VARIABLE };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zaravand-ui",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",