responsive-scale-mixins 2.2.0 → 2.2.1

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.
Files changed (3) hide show
  1. package/README.md +34 -2
  2. package/index.scss +13 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -50,7 +50,7 @@ Imagine building a beautiful UI in Figma, then seeing it perfectly scale on **ev
50
50
 
51
51
  Works with React, Vue, Angular, Svelte, Next.js, Nuxt, Astro, and vanilla CSS. Your favorite framework + perfect responsive design = ❤️
52
52
 
53
- ## 🚀 v2.2.0 - Universal Browser Compatibility (No Breaking Changes)
53
+ ## 🚀 v2.2.1 - Universal Browser Compatibility (No Breaking Changes)
54
54
 
55
55
  **Automatic fallback generation for browsers without CSS variable support!**
56
56
 
@@ -86,7 +86,7 @@ Works with React, Vue, Angular, Svelte, Next.js, Nuxt, Astro, and vanilla CSS. Y
86
86
  font-size: calc(100vw / 1920 * 48px);
87
87
  }
88
88
 
89
- // v2.1.0 output (works everywhere!)
89
+ // v2.2.1 output (works everywhere!)
90
90
  .hero-title {
91
91
  font-size: 48px; /* Fallback for old browsers */
92
92
  }
@@ -282,6 +282,38 @@ pnpm add responsive-scale-mixins
282
282
  // Import in app/layout.tsx: import './globals.scss'
283
283
  ```
284
284
 
285
+ ### Regression Test
286
+
287
+ To confirm the fix before publishing, run the local regression case included in `test/regression.scss`.
288
+
289
+ ```bash
290
+ cd test
291
+ ./test.sh
292
+ ```
293
+
294
+ If the build succeeds, verify that `test/regression.css` was generated and contains valid modern expressions such as:
295
+
296
+ ```css
297
+ padding: calc(
298
+ var(--computed-tablet-scale-factor) *
299
+ (5px + var(--tablet-proportion-scale-factor) * (10px - 5px))
300
+ )
301
+ calc(
302
+ var(--computed-tablet-scale-factor) *
303
+ (10px + var(--tablet-proportion-scale-factor) * (20px - 10px))
304
+ );
305
+ ```
306
+
307
+ Then verify the `@supports` output for the single-value case in `test.css` matches the corrected form:
308
+
309
+ ```css
310
+ @supports (margin: calc(100vw / 1920px * 10px)) {
311
+ .bar {
312
+ margin: calc(100vw / 1920px * 10px);
313
+ }
314
+ }
315
+ ```
316
+
285
317
  #### Next.js (Pages Router)
286
318
 
287
319
  ```scss
package/index.scss CHANGED
@@ -1,4 +1,4 @@
1
- // Responsive Scale Mixins v2.2.0
1
+ // Responsive Scale Mixins v2.2.1
2
2
  // A powerful SCSS mixin system for creating perfectly responsive designs
3
3
  // with universal browser compatibility and static fallbacks
4
4
  // Single-file distribution for maximum compatibility
@@ -88,6 +88,18 @@ $rsm-mobile-width: 390px !default;
88
88
  @return calc((100vw / #{$rsm-mobile-width}) * #{$mobile-value}#{$unit});
89
89
  }
90
90
 
91
+ @function get-scale-factor($unit) {
92
+ @return string.unquote("--computed-scale-factor");
93
+ }
94
+
95
+ @function get-tablet-scale-factor($unit) {
96
+ @return string.unquote("--computed-tablet-scale-factor");
97
+ }
98
+
99
+ @function get-mobile-scale-factor($unit) {
100
+ @return string.unquote("--computed-mobile-scale-factor");
101
+ }
102
+
91
103
  /* v2.2.0: Main responsive scale mixin with fallback support
92
104
  * Generates two CSS declarations:
93
105
  * 1. Static fallback value for unsupported browsers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "responsive-scale-mixins",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "🎨 Revolutionary SCSS mixins for perfect responsive design with universal browser compatibility. Supports ALL CSS units (px, rem, em, vw, vh, %, etc.) with pixel-perfect scaling and automatic fallbacks for browsers without CSS variable support. Zero manual calculations - just flawless responsive typography, spacing, and dimensions across desktop, tablet, and mobile. Single-file distribution for maximum compatibility. Framework-agnostic, works everywhere including Firefox Mobile and old Android browsers.",
5
5
  "main": "index.scss",
6
6
  "style": "index.scss",