@stylexjs/shared 0.9.2 → 0.10.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -50,8 +50,9 @@ function styleXCreateTheme(themeVars, variables, options) {
|
|
50
50
|
};
|
51
51
|
}
|
52
52
|
}
|
53
|
+
const themeClass = `${overrideClassName} ${themeVars.__themeName__}`;
|
53
54
|
return [{
|
54
55
|
$$css: true,
|
55
|
-
[themeVars.__themeName__]:
|
56
|
+
[themeVars.__themeName__]: themeClass
|
56
57
|
}, stylesToInject];
|
57
58
|
}
|
@@ -78,7 +78,8 @@ function constructCssVariablesString(variables, themeNameHash) {
|
|
78
78
|
const result = {};
|
79
79
|
for (const [atRule, value] of Object.entries(rulesByAtRule)) {
|
80
80
|
const suffix = atRule === 'default' ? '' : `-${(0, _hash.default)(atRule)}`;
|
81
|
-
|
81
|
+
const selector = `:root, .${themeNameHash}`;
|
82
|
+
let ltr = `${selector}{${value.join('')}}`;
|
82
83
|
if (atRule !== 'default') {
|
83
84
|
ltr = (0, _stylexVarsUtils.wrapWithAtRules)(ltr, atRule);
|
84
85
|
}
|
@@ -9,17 +9,4 @@
|
|
9
9
|
|
10
10
|
import type { StyleXOptions } from '../common-types';
|
11
11
|
|
12
|
-
// {
|
13
|
-
// ...options,
|
14
|
-
// dev: !!(options as any).dev,
|
15
|
-
// test: !!(options as any).test,
|
16
|
-
// stylexSheetName: (options as any).stylexSheetName ?? undefined,
|
17
|
-
// classNamePrefix: (options as any).classNamePrefix ?? 'x',
|
18
|
-
// importSources: (options as any).importSources ?? [name, 'stylex'],
|
19
|
-
// definedStylexCSSVariables:
|
20
|
-
// (options as any).definedStylexCSSVariables ?? {},
|
21
|
-
// genConditionalClasses: !!(options as any).genConditionalClasses,
|
22
|
-
// skipShorthandExpansion: !!(options as any).skipShorthandExpansion,
|
23
|
-
// } as StyleXOptions;
|
24
|
-
|
25
12
|
declare export const defaultOptions: StyleXOptions;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@stylexjs/shared",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.10.0-beta.1",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"repository": "https://www.github.com/facebook/stylex",
|
6
6
|
"license": "MIT",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"postcss-value-parser": "^4.1.0"
|
14
14
|
},
|
15
15
|
"devDependencies": {
|
16
|
-
"@stylexjs/scripts": "0.
|
16
|
+
"@stylexjs/scripts": "0.10.0-beta.1"
|
17
17
|
},
|
18
18
|
"jest": {
|
19
19
|
"snapshotFormat": {
|