react-native-css 0.0.0-nightly.7bc9102 → 0.0.0-nightly.8c2d0a1
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 +138 -10
- package/dist/commonjs/babel/index.js +6 -2
- package/dist/commonjs/babel/index.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +6 -26
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +70 -23
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/compiler.types.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +174 -83
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inline-variables.js +142 -0
- package/dist/commonjs/compiler/inline-variables.js.map +1 -0
- package/dist/commonjs/compiler/selector-builder.js +6 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +8 -4
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.native.js +3 -3
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/commonjs/jest/index.js +1 -2
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +8 -8
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/runtime/native/api.js +29 -4
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +3 -2
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +3 -11
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/calculate-props.js +13 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/line-height.js +25 -0
- package/dist/commonjs/runtime/native/styles/line-height.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/resolve.js +2 -0
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +11 -13
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/units.js +10 -8
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js +18 -0
- package/dist/commonjs/runtime/web/api.js.map +1 -1
- package/dist/commonjs/style-collection/index.js +6 -1
- package/dist/commonjs/style-collection/index.js.map +1 -1
- package/dist/commonjs/style-collection/root.js +6 -0
- package/dist/commonjs/style-collection/root.js.map +1 -1
- package/dist/module/babel/index.js +2 -2
- package/dist/module/babel/index.js.map +1 -1
- package/dist/module/compiler/atRules.js +6 -26
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +72 -25
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +169 -83
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inline-variables.js +138 -0
- package/dist/module/compiler/inline-variables.js.map +1 -0
- package/dist/module/compiler/selector-builder.js +6 -4
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +8 -4
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/components/react-native-safe-area-context.native.js +1 -1
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/module/jest/index.js +2 -3
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +8 -8
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/runtime/native/api.js +24 -5
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +2 -1
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +1 -9
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/styles/calculate-props.js +13 -0
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/line-height.js +20 -0
- package/dist/module/runtime/native/styles/line-height.js.map +1 -0
- package/dist/module/runtime/native/styles/resolve.js +2 -0
- package/dist/module/runtime/native/styles/resolve.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js +11 -13
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/runtime/native/styles/units.js +11 -8
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +1 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/web/api.js +18 -1
- package/dist/module/runtime/web/api.js.map +1 -1
- package/dist/module/style-collection/index.js +6 -1
- package/dist/module/style-collection/index.js.map +1 -1
- package/dist/module/style-collection/root.js +6 -0
- package/dist/module/style-collection/root.js.map +1 -1
- package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/index.d.ts +3 -0
- package/dist/typescript/commonjs/src/babel/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +10 -6
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +19 -8
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts +4 -0
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +14 -2
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/line-height.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/line-height.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts +8 -2
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/style-collection/index.d.ts +4 -1
- package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -1
- package/dist/typescript/module/example/src/App.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/index.d.ts +3 -0
- package/dist/typescript/module/src/babel/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +10 -6
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +19 -8
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +4 -0
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +1 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts +14 -2
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/line-height.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/line-height.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts +8 -2
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/style-collection/index.d.ts +4 -1
- package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -1
- package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -1
- package/package.json +11 -13
- package/src/babel/index.ts +2 -2
- package/src/compiler/atRules.ts +4 -26
- package/src/compiler/compiler.ts +89 -27
- package/src/compiler/compiler.types.ts +15 -6
- package/src/compiler/declarations.ts +231 -121
- package/src/compiler/inline-variables.ts +209 -0
- package/src/compiler/selector-builder.ts +7 -5
- package/src/compiler/stylesheet.ts +10 -9
- package/src/components/react-native-safe-area-context.native.tsx +1 -2
- package/src/jest/index.ts +3 -4
- package/src/metro/index.ts +12 -11
- package/src/runtime/native/{api.ts → api.tsx} +37 -6
- package/src/runtime/native/react/useNativeCss.ts +2 -1
- package/src/runtime/native/reactivity.ts +1 -8
- package/src/runtime/native/styles/calculate-props.ts +19 -1
- package/src/runtime/native/styles/line-height.ts +25 -0
- package/src/runtime/native/styles/resolve.ts +2 -0
- package/src/runtime/native/styles/shorthands/box-shadow.ts +15 -19
- package/src/runtime/native/styles/units.ts +13 -8
- package/src/runtime/native/styles/variables.ts +1 -1
- package/src/runtime/web/{api.ts → api.tsx} +28 -2
- package/src/style-collection/index.ts +14 -0
- package/src/style-collection/root.ts +13 -0
package/README.md
CHANGED
|
@@ -13,10 +13,12 @@ The goal of this library is to provide the most complete CSS support for React N
|
|
|
13
13
|
### Metro based projects
|
|
14
14
|
|
|
15
15
|
> [!TIP]
|
|
16
|
-
>
|
|
16
|
+
> Most React Native projects use Metro as the bundler.
|
|
17
17
|
|
|
18
18
|
You will need to add `withReactNativeCSS` to your Metro configuration.
|
|
19
19
|
|
|
20
|
+
#### Expo Projects
|
|
21
|
+
|
|
20
22
|
```ts
|
|
21
23
|
import { getDefaultConfig } from "expo/metro-config";
|
|
22
24
|
import { withReactNativeCSS } from "react-native-css/metro";
|
|
@@ -31,6 +33,17 @@ export default withReactNativeCSS(defaultConfig, {
|
|
|
31
33
|
});
|
|
32
34
|
```
|
|
33
35
|
|
|
36
|
+
#### Non-Expo Projects
|
|
37
|
+
|
|
38
|
+
`react-native-css` relies on the bundler to process CSS files. Currently only Expo provides a CSS asset pipeline. Since the Expo SDK is modular, you can add this functionality by just using the `@expo/metro-config` package.
|
|
39
|
+
|
|
40
|
+
Follow the Expo instructions, but replace the `expo` package with `@expo/metro-config`.
|
|
41
|
+
|
|
42
|
+
```diff
|
|
43
|
+
- import { getDefaultConfig } from "expo/metro-config";
|
|
44
|
+
+ import { getDefaultConfig } from "@expo/metro-config";
|
|
45
|
+
```
|
|
46
|
+
|
|
34
47
|
### Other bundlers
|
|
35
48
|
|
|
36
49
|
`react-native-css` officially only supports Metro as the bundler, but we welcome community contributions to support other bundlers like Webpack, Vite or Turbopack.
|
|
@@ -88,23 +101,42 @@ module.exports = withReactNativeCSS(
|
|
|
88
101
|
);
|
|
89
102
|
```
|
|
90
103
|
|
|
91
|
-
### Via
|
|
104
|
+
### Via `styled`
|
|
105
|
+
|
|
106
|
+
You can also use the `styled` function to get styled components.
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { View } from 'react-native';
|
|
110
|
+
import { styled } from 'react-native-css';
|
|
111
|
+
|
|
112
|
+
import "./styles.css";
|
|
113
|
+
|
|
114
|
+
const MyView = styled(View)
|
|
115
|
+
|
|
116
|
+
export default function App() {
|
|
117
|
+
return (
|
|
118
|
+
<MyView className="container">
|
|
119
|
+
<MyView className="box" />
|
|
120
|
+
</View>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
```
|
|
92
124
|
|
|
93
|
-
|
|
125
|
+
### Via hooks
|
|
94
126
|
|
|
95
127
|
You can also use the `useCssElement` hook.
|
|
96
128
|
|
|
97
129
|
```ts
|
|
98
|
-
import { View
|
|
130
|
+
import { View } from 'react-native';
|
|
99
131
|
import { useCssElement } from 'react-native-css';
|
|
100
132
|
|
|
101
133
|
export default function App() {
|
|
102
|
-
const Container = useCssElement(
|
|
134
|
+
const Container = useCssElement(View, {
|
|
103
135
|
className: "container",
|
|
104
136
|
});
|
|
105
137
|
|
|
106
|
-
const Box = useCssElement(
|
|
107
|
-
className: "
|
|
138
|
+
const Box = useCssElement(View, {
|
|
139
|
+
className: "box",
|
|
108
140
|
});
|
|
109
141
|
|
|
110
142
|
return (
|
|
@@ -116,11 +148,11 @@ export default function App() {
|
|
|
116
148
|
```
|
|
117
149
|
|
|
118
150
|
> [!IMPORTANT]
|
|
119
|
-
> The hook returns a React Element, not a style object.
|
|
151
|
+
> The hook returns a React Element, not a style object.
|
|
120
152
|
|
|
121
153
|
#### `useNativeCssStyle`
|
|
122
154
|
|
|
123
|
-
If you just require the style object, you can use the `useNativeCssStyle` hook
|
|
155
|
+
If you just require the style object, you can use the `useNativeCssStyle` hook
|
|
124
156
|
|
|
125
157
|
```ts
|
|
126
158
|
import { View as RNView } from 'react-native';
|
|
@@ -152,7 +184,7 @@ If you just require a CSS variable value, you can use the `useNativeCssVariable`
|
|
|
152
184
|
import { useNativeCssVariable } from 'react-native-css';
|
|
153
185
|
|
|
154
186
|
export default function App() {
|
|
155
|
-
const myColor = useNativeCssVariable("my-color");
|
|
187
|
+
const myColor = useNativeCssVariable("--my-color");
|
|
156
188
|
|
|
157
189
|
return (
|
|
158
190
|
<View style={{ backgroundColor: myColor }}>
|
|
@@ -168,6 +200,102 @@ export default function App() {
|
|
|
168
200
|
> This hook may will only work on native platforms. It will return `undefined` on web.
|
|
169
201
|
> This hook may not support all features of the library.
|
|
170
202
|
|
|
203
|
+
## CSS variables
|
|
204
|
+
|
|
205
|
+
It is preferable that all CSS variables are set via CSS. If you need values to change dynamically, we recommend using a class to change the values.
|
|
206
|
+
|
|
207
|
+
```css
|
|
208
|
+
.theme-red {
|
|
209
|
+
--brand-color: red;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.theme-blue {
|
|
213
|
+
--brand-color: blue;
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
As a last resort, you can use `VariableContext` to dynamically set CSS variables in JavaScript
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
import { VariableContext } from 'react-native-css';
|
|
221
|
+
|
|
222
|
+
export default function App() {
|
|
223
|
+
return (
|
|
224
|
+
<VariableContext values={{ "--my-color": "red" }}>
|
|
225
|
+
<Text className="my-color-text">
|
|
226
|
+
Hello, world!
|
|
227
|
+
</Text>
|
|
228
|
+
</VariableContext>
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
This API only allows for setting CSS variables as primitive values. For more complex styles, you will need to use a helper CSS class.
|
|
234
|
+
|
|
235
|
+
> [!IMPORTANT]
|
|
236
|
+
> By using `VariableContext` you may need to disable the `inlineVariable` optimization
|
|
237
|
+
|
|
238
|
+
## Optimizations
|
|
239
|
+
|
|
240
|
+
CSS is a dynamic styling language that use highly optimized engines that are not available in React Native. Instead, we optimize the styles to improve performance
|
|
241
|
+
|
|
242
|
+
These optimizations are only applied in native environments and are enabled by default.
|
|
243
|
+
|
|
244
|
+
### Inline REM units
|
|
245
|
+
|
|
246
|
+
All `rem` units are converted to `dp` units at build time. On native, the default dp is 14. You can change the default `rem` by passing a `inlineRem` option to the `withReactNativeCSS` function.
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
export default withReactNativeCSS(defaultConfig, {
|
|
250
|
+
inlineRem: 16, // change to 16dp,
|
|
251
|
+
});
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Inline CSS Custom Properties (variables)
|
|
255
|
+
|
|
256
|
+
Custom properties (sometimes referred to as CSS variables or cascading variables) are a way to store values that can be reused throughout a CSS document. They are defined using a property name that starts with `--`, and their values can be accessed using the `var()` function.
|
|
257
|
+
|
|
258
|
+
To improve performance, Custom properties that are only set **once** in the CSS file are inlined at build time.
|
|
259
|
+
|
|
260
|
+
For example
|
|
261
|
+
|
|
262
|
+
```css
|
|
263
|
+
:root {
|
|
264
|
+
--my-var: red;
|
|
265
|
+
--var-with-two-possible-values: blue;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.my-class {
|
|
269
|
+
--var-with-two-possible-values: green;
|
|
270
|
+
color: var(--my-var);
|
|
271
|
+
background-color: var(--var-with-two-possible-values);
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Is converted to:
|
|
276
|
+
|
|
277
|
+
```css
|
|
278
|
+
:root {
|
|
279
|
+
--var-with-two-possible-values: blue;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.my-class {
|
|
283
|
+
color: red; /* This was inlined and the variable was removed */
|
|
284
|
+
|
|
285
|
+
/* These are preserved as there are multiple possible values */
|
|
286
|
+
--var-with-two-possible-values: green;
|
|
287
|
+
background-color: var(--var-with-two-possible-values);
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Using `VariableContext` with `inlineVariables` may have unexpected results, as rules may have been rewritten not to use a variable. You can disable this behavior by setting `inlineVariables: false`
|
|
292
|
+
|
|
293
|
+
```tsx
|
|
294
|
+
export default withReactNativeCSS(defaultConfig, {
|
|
295
|
+
inlineVariables: false,
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
171
299
|
## Contributing
|
|
172
300
|
|
|
173
301
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
3
7
|
/* eslint-disable */
|
|
4
|
-
|
|
8
|
+
function _default() {
|
|
5
9
|
return {
|
|
6
10
|
plugins: [require("./import-plugin").default, "react-native-worklets/plugin"]
|
|
7
11
|
};
|
|
8
|
-
}
|
|
12
|
+
}
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_default","plugins","require","default"],"sourceRoot":"../../../src","sources":["babel/index.ts"],"mappings":";;;;;;AAAA;AACe,SAAAA,SAAA,EAAY;EACzB,OAAO;IACLC,OAAO,EAAE,CACPC,OAAO,CAAC,iBAAiB,CAAC,CAACC,OAAO,EAClC,8BAA8B;EAElC,CAAC;AACH","ignoreList":[]}
|
|
@@ -11,34 +11,12 @@ var _splitByDelimiter = require("./split-by-delimiter.js");
|
|
|
11
11
|
* @react-native *
|
|
12
12
|
***********************************************/
|
|
13
13
|
|
|
14
|
-
function maybeMutateReactNativeOptions(rule,
|
|
14
|
+
function maybeMutateReactNativeOptions(rule, _builder) {
|
|
15
15
|
if (rule.type !== "custom" || rule.value?.name !== "react-native") {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = rule.value.body.value;
|
|
21
|
-
if (!declarations) return;
|
|
22
|
-
for (const declaration of declarations) {
|
|
23
|
-
if (declaration.property !== "custom") continue;
|
|
24
|
-
switch (declaration.value.name) {
|
|
25
|
-
case "preserve-variables":
|
|
26
|
-
{
|
|
27
|
-
declaration.value.value.forEach(token => {
|
|
28
|
-
if (token.type !== "dashed-ident") {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (token.value !== "true" && token.value !== "false") {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
builder.setOptions("preserveVariables", token.value === "true");
|
|
35
|
-
});
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
default:
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
18
|
+
|
|
19
|
+
// TODO: Add inline options
|
|
42
20
|
}
|
|
43
21
|
|
|
44
22
|
/***********************************************
|
|
@@ -57,7 +35,9 @@ function parsePropAtRule(rules) {
|
|
|
57
35
|
"stroke-width": ["strokeWidth"],
|
|
58
36
|
"-webkit-line-clamp": ["numberOfLines"],
|
|
59
37
|
"-rn-ripple-color": ["android_ripple", "color"],
|
|
60
|
-
"-rn-ripple-style": ["android_ripple", "borderless"]
|
|
38
|
+
"-rn-ripple-style": ["android_ripple", "borderless"],
|
|
39
|
+
"-rn-ripple-radius": ["android_ripple", "radius"],
|
|
40
|
+
"-rn-ripple-layer": ["android_ripple", "foreground"]
|
|
61
41
|
};
|
|
62
42
|
if (!rules) return mapping;
|
|
63
43
|
for (const rule of rules) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_selectors","require","_splitByDelimiter","maybeMutateReactNativeOptions","rule","
|
|
1
|
+
{"version":3,"names":["_selectors","require","_splitByDelimiter","maybeMutateReactNativeOptions","rule","_builder","type","value","name","isPropAtRule","parsePropAtRule","rules","mapping","prelude","length","filter","item","propAtRuleBlock","block","blocks","blockRules","splitByDelimiter","token","from","to","fromToken","toRNProperty","flatMap","index"],"sourceRoot":"../../../src","sources":["compiler/atRules.ts"],"mappings":";;;;;;;AAQA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAYA;AACA;AACA;;AAcO,SAASE,6BAA6BA,CAC3CC,IAA8B,EAC9BC,QAA2B,EAC3B;EACA,IAAID,IAAI,CAACE,IAAI,KAAK,QAAQ,IAAIF,IAAI,CAACG,KAAK,EAAEC,IAAI,KAAK,cAAc,EAAE;IACjE;EACF;;EAEA;AACF;;AAEA;AACA;AACA;;AAEA,SAASC,YAAYA,CAACL,IAAuB,EAAsB;EACjE,OAAOA,IAAI,CAACE,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACG,KAAK,CAACC,IAAI,KAAK,MAAM;AAC9D;AAEO,SAASE,eAAeA,CAACC,KAA6B,EAAE;EAC7D;EACA,MAAMC,OAAyB,GAAG;IAChC,aAAa,EAAE,CAAC,aAAa,CAAC;IAC9B,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/B,oBAAoB,EAAE,CAAC,eAAe,CAAC;IACvC,kBAAkB,EAAE,CAAC,gBAAgB,EAAE,OAAO,CA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CAAgB,EAACC,KAAK,EAAGN,IAAI,IAAK;IACnD,OAAOA,IAAI,CAACT,KAAK,CAACD,IAAI,KAAK,OAAO;EACpC,CAAC,CAAC;EAEF,IAAI,CAACiB,IAAI,IAAIA,IAAI,CAACT,MAAM,KAAK,CAAC,EAAE;IAC9B,OAAOF,OAAO;EAChB;EAEA,MAAMa,SAAS,GAAGF,IAAI,CAAC,CAAC,CAAC;EACzB,IAAI,CAACE,SAAS,IAAIA,SAAS,CAAClB,KAAK,CAACD,IAAI,KAAK,OAAO,EAAE;IAClD,OAAOM,OAAO;EAChB;EAEA,IAAI,CAACY,EAAE,EAAE;IACPZ,OAAO,CAAC,GAAG,CAAC,GAAG,IAAAc,uBAAY,EAACD,SAAS,CAAClB,KAAK,CAACA,KAAK,CAAC;IAClD,OAAOK,OAAO;EAChB;EAEAA,OAAO,CAAC,IAAAc,uBAAY,EAACD,SAAS,CAAClB,KAAK,CAACA,KAAK,CAAC,CAAC,GAAGiB,EAAE,CAACG,OAAO,CAAC,CAACX,IAAI,EAAEY,KAAK,KAAK;IACzE,QAAQZ,IAAI,CAACT,KAAK,CAACD,IAAI;MACrB,KAAK,OAAO;QACV,OAAOsB,KAAK,KAAK,CAAC,IAAIZ,IAAI,CAACT,KAAK,CAACA,KAAK,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE;MAC7D,KAAK,OAAO;QACV,OAAO,CAAC,IAAAmB,uBAAY,EAACV,IAAI,CAACT,KAAK,CAACA,KAAK,CAAC,CAAC;MACzC;QACE,OAAO,EAAE;IACb;EACF,CAAC,CAAC;EAEF,OAAOK,OAAO;AAChB","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ var _lightningcss = require("lightningcss");
|
|
|
10
10
|
var _atRules = require("./atRules.js");
|
|
11
11
|
var _containerQuery = require("./container-query.js");
|
|
12
12
|
var _declarations = require("./declarations.js");
|
|
13
|
+
var _inlineVariables = require("./inline-variables.js");
|
|
13
14
|
var _keyframes = require("./keyframes.js");
|
|
14
15
|
var _mediaQuery = require("./media-query.js");
|
|
15
16
|
var _stylesheet = require("./stylesheet.js");
|
|
@@ -41,7 +42,72 @@ function compile(code, options = {}) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
const builder = new _stylesheet.StylesheetBuilder(options);
|
|
44
|
-
logger(`
|
|
45
|
+
logger(`Lightningcss first pass`);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Use the lightningcss library to traverse the CSS AST and extract style declarations and animations
|
|
49
|
+
*
|
|
50
|
+
* devongovett on Aug 20, 2023
|
|
51
|
+
* > calc simplification happens during the initial parse phase, which is before custom visitors run. Currently there is not an additional simplification pass done after transforms, resulting in the output you see here.
|
|
52
|
+
* https://github.com/parcel-bundler/lightningcss/issues/554#issuecomment-1685143494
|
|
53
|
+
*
|
|
54
|
+
* Due to the above issue, we run lightningcss twice
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
const vars = new Map();
|
|
58
|
+
const firstPassVisitor = {};
|
|
59
|
+
if (options.inlineRem !== false) {
|
|
60
|
+
firstPassVisitor.Length = length => {
|
|
61
|
+
if (length.unit !== "rem" || options.inlineRem === false) {
|
|
62
|
+
return length;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
unit: "px",
|
|
66
|
+
value: (0, _declarations.round)(length.value * (options.inlineRem ?? 14))
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (options.inlineVariables !== false) {
|
|
71
|
+
const exclusionList = options.inlineVariables?.exclude ?? [];
|
|
72
|
+
firstPassVisitor.Declaration = decl => {
|
|
73
|
+
if (decl.property === "custom" && decl.value.name.startsWith("--") && !exclusionList.includes(decl.value.name)) {
|
|
74
|
+
const entry = vars.get(decl.value.name) ?? {
|
|
75
|
+
count: 0,
|
|
76
|
+
value: [...decl.value.value, {
|
|
77
|
+
type: "token",
|
|
78
|
+
value: {
|
|
79
|
+
type: "white-space",
|
|
80
|
+
value: " "
|
|
81
|
+
}
|
|
82
|
+
}]
|
|
83
|
+
};
|
|
84
|
+
entry.count++;
|
|
85
|
+
vars.set(decl.value.name, entry);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
firstPassVisitor.StyleSheetExit = sheet => {
|
|
89
|
+
return (0, _inlineVariables.inlineVariables)(sheet, vars);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const {
|
|
93
|
+
code: firstPass
|
|
94
|
+
} = (0, _lightningcss.transform)({
|
|
95
|
+
code: typeof code === "string" ? new TextEncoder().encode(code) : code,
|
|
96
|
+
include: _lightningcss.Features.DoublePositionGradients | _lightningcss.Features.ColorFunction,
|
|
97
|
+
exclude: _lightningcss.Features.VendorPrefixes,
|
|
98
|
+
visitor: firstPassVisitor,
|
|
99
|
+
filename: options.filename ?? "style.css",
|
|
100
|
+
projectRoot: options.projectRoot ?? process.cwd()
|
|
101
|
+
});
|
|
102
|
+
if (isLoggerEnabled) {
|
|
103
|
+
const MAX_LOG_SIZE = 100 * 1024; // 100KB
|
|
104
|
+
if (firstPass.length <= MAX_LOG_SIZE) {
|
|
105
|
+
logger(firstPass.toString());
|
|
106
|
+
} else {
|
|
107
|
+
logger(`firstPass buffer too large to log in full (${firstPass.length} bytes). Preview: ` + firstPass.subarray(0, 1024).toString() + "...");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
logger(`Lightningcss second pass`);
|
|
45
111
|
const customAtRules = {
|
|
46
112
|
"react-native": {
|
|
47
113
|
body: "declaration-list"
|
|
@@ -50,6 +116,7 @@ function compile(code, options = {}) {
|
|
|
50
116
|
const visitor = {
|
|
51
117
|
Rule(rule) {
|
|
52
118
|
(0, _atRules.maybeMutateReactNativeOptions)(rule, builder);
|
|
119
|
+
return rule;
|
|
53
120
|
},
|
|
54
121
|
StyleSheetExit(sheet) {
|
|
55
122
|
if (isLoggerEnabled) {
|
|
@@ -66,31 +133,11 @@ function compile(code, options = {}) {
|
|
|
66
133
|
// We have processed this rule, so now delete it from the AST
|
|
67
134
|
}
|
|
68
135
|
logger(`Exiting lightningcss`);
|
|
136
|
+
return sheet;
|
|
69
137
|
}
|
|
70
138
|
};
|
|
71
|
-
if (options.stripUnusedVariables) {
|
|
72
|
-
const onVarUsage = token => {
|
|
73
|
-
if (token.type === "function") {
|
|
74
|
-
token.value.arguments.forEach(token => onVarUsage(token));
|
|
75
|
-
} else if (token.type === "var") {
|
|
76
|
-
builder.varUsage.add(token.value.name.ident);
|
|
77
|
-
if (token.value.fallback) {
|
|
78
|
-
const fallbackValues = token.value.fallback;
|
|
79
|
-
fallbackValues.forEach(varObj => onVarUsage(varObj));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
visitor.Declaration = decl => {
|
|
84
|
-
if (decl.property === "unparsed" || decl.property === "custom") {
|
|
85
|
-
decl.value.value.forEach(token => onVarUsage(token));
|
|
86
|
-
}
|
|
87
|
-
return decl;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Use the lightningcss library to traverse the CSS AST and extract style declarations and animations
|
|
92
139
|
(0, _lightningcss.transform)({
|
|
93
|
-
code:
|
|
140
|
+
code: firstPass,
|
|
94
141
|
visitor,
|
|
95
142
|
filename: options.filename ?? "style.css",
|
|
96
143
|
projectRoot: options.projectRoot ?? process.cwd()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_nodeUtil","require","_debug","_lightningcss","_atRules","_containerQuery","_declarations","_keyframes","_mediaQuery","_stylesheet","_supports","defaultLogger","debug","compile","code","options","logger","isLoggerEnabled","enabled","Boolean","features","Object","assign","selectorPrefix","startsWith","slice","JSON","stringify","process","env","NODE_ENV","toString","builder","StylesheetBuilder","
|
|
1
|
+
{"version":3,"names":["_nodeUtil","require","_debug","_lightningcss","_atRules","_containerQuery","_declarations","_inlineVariables","_keyframes","_mediaQuery","_stylesheet","_supports","defaultLogger","debug","compile","code","options","logger","isLoggerEnabled","enabled","Boolean","features","Object","assign","selectorPrefix","startsWith","slice","JSON","stringify","process","env","NODE_ENV","toString","builder","StylesheetBuilder","vars","Map","firstPassVisitor","inlineRem","Length","length","unit","value","round","inlineVariables","exclusionList","exclude","Declaration","decl","property","name","includes","entry","get","count","type","set","StyleSheetExit","sheet","firstPass","lightningcss","TextEncoder","encode","include","Features","DoublePositionGradients","ColorFunction","VendorPrefixes","visitor","filename","projectRoot","cwd","MAX_LOG_SIZE","subarray","customAtRules","body","Rule","rule","maybeMutateReactNativeOptions","rules","inspect","depth","colors","compact","extractRule","stylesheet","getNativeStyleSheet","warnings","getWarnings","extractKeyFrames","extractContainer","extractMedia","declarationBlock","declarations","newNestedRule","declaration","parseDeclaration","applyRuleToSelectors","importantDeclarations","important","mapping","parsePropAtRule","fork","selectors","newRule","nestedRule","layerRule","supportsConditionValid","condition","mediaRule","media","mediaQuery","query","mediaQueries","mediaType","qualifier","push","m","parseMediaQuery","containerRule","parseContainerCondition","n","addContainerQuery"],"sourceRoot":"../../../src","sources":["compiler/compiler.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAWA,IAAAG,QAAA,GAAAH,OAAA;AAMA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AA3BA;;AA6BA,MAAMW,aAAa,GAAG,IAAAC,YAAK,EAAC,2BAA2B,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAACC,IAAqB,EAAEC,OAAwB,GAAG,CAAC,CAAC,EAAE;EAC5E,MAAM;IAAEC,MAAM,GAAGL;EAAc,CAAC,GAAGI,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IACCF,UAAU,CAACG,SAAS,KAAK,OAAO,IAAIH,UAAU,CAACI,SAAS,KAAK,KAAK;IACnE;IACA;IACCJ,UAAU,CAACG,SAAS,KAAK,OAAO,IAC/BH,UAAU,CAACI,SAAS,KAAK,KAAK,IAC9BJ,UAAU,CAACH,SAAS,KAAK,IAAK,EAChC;MACA;IACF;IAEAE,KAAK,CAACM,IAAI,CAACL,UAAU,CAAC;EACxB;EAEA,IAAID,KAAK,CAACtE,MAAM,KAAK,CAAC,EAAE;IACtB;EACF;EAEA,KAAK,MAAM6E,CAAC,IAAIP,KAAK,EAAE;IACrB,IAAAQ,2BAAe,EAACD,CAAC,EAAEpF,OAAO,CAAC;EAC7B;;EAEA;EACA,KAAK,MAAM4C,IAAI,IAAIgC,SAAS,CAAC9B,KAAK,EAAE;IAClCK,WAAW,CAACP,IAAI,EAAE5C,OAAO,CAAC;EAC5B;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASyD,gBAAgBA,CACvB6B,aAA4B,EAC5BtF,OAA0B,EAC1B;EACAA,OAAO,GAAGA,OAAO,CAACqE,IAAI,CAAC,WAAW,CAAC;;EAEnC;EACA,MAAMU,KAAqB,GAAG;IAC5BK,CAAC,EAAE,IAAAG,uCAAuB,EAACD,aAAa,CAACX,SAAS,EAAE3E,OAAO;EAC7D,CAAC;EAED,IAAIsF,aAAa,CAACrE,IAAI,EAAE;IACtB8D,KAAK,CAACS,CAAC,GAAG,KAAKF,aAAa,CAACrE,IAAI,EAAE;EACrC;EAEAjB,OAAO,CAACyF,iBAAiB,CAACV,KAAK,CAAC;EAEhC,KAAK,MAAMnC,IAAI,IAAI0C,aAAa,CAACxC,KAAK,EAAE;IACtCK,WAAW,CAACP,IAAI,EAAE5C,OAAO,CAAC;EAC5B;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactivity","require"],"sourceRoot":"../../../src","sources":["compiler/compiler.types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["_reactivity","require"],"sourceRoot":"../../../src","sources":["compiler/compiler.types.ts"],"mappings":";;AAOA,IAAAA,WAAA,GAAAC,OAAA","ignoreList":[]}
|