@cssxjs/loaders 0.2.31 → 0.2.32

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.2.32](https://github.com/startupjs/cssx/compare/v0.2.31...v0.2.32) (2026-01-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **runtime:** support var() in shorthand values and in various complex cases ([4483f54](https://github.com/startupjs/cssx/commit/4483f54d9507ebb38eb5f056de3fcac39862cb30))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.2.31](https://github.com/startupjs/cssx/compare/v0.2.30...v0.2.31) (2026-01-23)
7
18
 
8
19
 
@@ -2,7 +2,8 @@
2
2
  const css2rn = require('@startupjs/css-to-react-native-transform').default
3
3
 
4
4
  const EXPORT_REGEX = /:export\s*\{/
5
- const VAR_NAMES_REGEX = /"var\(\s*--[A-Za-z0-9_-]+/g
5
+ // Match var() anywhere in a string value (not just at the start)
6
+ const VAR_NAMES_REGEX = /var\(\s*(--[A-Za-z0-9_-]+)/g
6
7
 
7
8
  module.exports = function cssToReactNative (source) {
8
9
  source = escapeExport(source)
@@ -100,11 +101,10 @@ function simpleNumericHash (s) {
100
101
  }
101
102
 
102
103
  function getVariableNames (cssString) {
103
- let res = cssString.match(VAR_NAMES_REGEX)
104
- if (!res) return
105
- res = res.map(i => i.replace(/"var\(\s*/, ''))
106
- res = [...new Set(res)].sort() // remove duplicates and sort
107
- return res
104
+ const matches = [...cssString.matchAll(VAR_NAMES_REGEX)]
105
+ if (!matches.length) return
106
+ const res = matches.map(m => m[1]) // extract capture group (variable name)
107
+ return [...new Set(res)].sort() // remove duplicates and sort
108
108
  }
109
109
 
110
110
  function hasMedia (styles = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssxjs/loaders",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "Webpack-compatible loaders for CSSX styles in React Native and Web bundlers",
5
5
  "exports": {
6
6
  "./callLoader": "./callLoader.js",
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@startupjs/css-to-react-native-transform": "2.1.0-2",
23
+ "@startupjs/css-to-react-native-transform": "2.1.0-3",
24
24
  "stylus": "0.64.0"
25
25
  },
26
- "gitHead": "989ab68dbc3ed81262ccc51946ddaa01b90416a5"
26
+ "gitHead": "2d5f40fdc99ec3cbfb397741444993e2d09d7975"
27
27
  }