@stylexjs/stylex 0.5.0-alpha.4 → 0.5.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.
- package/README.md +4 -6
- package/lib/StyleXCSSTypes.d.ts +5 -3
- package/lib/StyleXCSSTypes.js.flow +6 -3
- package/lib/StyleXTypes.d.ts +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ below, there are 2 different CSS rules. The names "root" and "highlighted" are
|
|
|
62
62
|
arbitrary names given to the rules.
|
|
63
63
|
|
|
64
64
|
```tsx
|
|
65
|
-
import stylex from '@stylexjs/stylex';
|
|
65
|
+
import * as stylex from '@stylexjs/stylex';
|
|
66
66
|
|
|
67
67
|
const styles = stylex.create({
|
|
68
68
|
root: {
|
|
@@ -78,7 +78,7 @@ const styles = stylex.create({
|
|
|
78
78
|
Pseudo-classes and Media Queries can be nested within style definitions:
|
|
79
79
|
|
|
80
80
|
```tsx
|
|
81
|
-
import stylex from '@stylexjs/stylex';
|
|
81
|
+
import * as stylex from '@stylexjs/stylex';
|
|
82
82
|
|
|
83
83
|
const styles = stylex.create({
|
|
84
84
|
root: {
|
|
@@ -156,7 +156,7 @@ Defining fallback styles is done with `stylex.firstThatWorks()`. This is useful
|
|
|
156
156
|
for engines that may not support a specific style property.
|
|
157
157
|
|
|
158
158
|
```tsx
|
|
159
|
-
import stylex from '@stylexjs/stylex';
|
|
159
|
+
import * as stylex from '@stylexjs/stylex';
|
|
160
160
|
|
|
161
161
|
const styles = stylex.create({
|
|
162
162
|
header: {
|
|
@@ -211,8 +211,6 @@ type Props = {
|
|
|
211
211
|
};
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
|
|
216
214
|
### `StaticStyles<>`
|
|
217
215
|
|
|
218
216
|
To constrain the styles to specific properties and values, use the `StaticStyles<>`
|
|
@@ -235,7 +233,7 @@ StyleX produces atomic styles, which means that each CSS rule contains only a
|
|
|
235
233
|
single declaration and uses a unique class name. For example:
|
|
236
234
|
|
|
237
235
|
```tsx
|
|
238
|
-
import stylex from '@stylexjs/stylex';
|
|
236
|
+
import * as stylex from '@stylexjs/stylex';
|
|
239
237
|
|
|
240
238
|
const styles = stylex.create({
|
|
241
239
|
root: {
|
package/lib/StyleXCSSTypes.d.ts
CHANGED
|
@@ -237,6 +237,7 @@ type display =
|
|
|
237
237
|
| 'inline-flex'
|
|
238
238
|
| 'grid'
|
|
239
239
|
| 'inline-grid'
|
|
240
|
+
| '-webkit-box'
|
|
240
241
|
| 'run-in'
|
|
241
242
|
| 'ruby'
|
|
242
243
|
| 'ruby-base'
|
|
@@ -469,7 +470,7 @@ type MsOverflowStyle =
|
|
|
469
470
|
| '-ms-autohiding-scrollbar';
|
|
470
471
|
type objectFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
471
472
|
type objectPosition = string;
|
|
472
|
-
type opacity = number;
|
|
473
|
+
type opacity = number | string;
|
|
473
474
|
type order = number;
|
|
474
475
|
type orphans = number;
|
|
475
476
|
type outline = string;
|
|
@@ -1289,7 +1290,6 @@ export type CSSProperties = Readonly<{
|
|
|
1289
1290
|
mathDepth?: all | number | string;
|
|
1290
1291
|
mathShift?: all | 'normal' | 'compact';
|
|
1291
1292
|
mathStyle?: all | 'normal' | 'compact';
|
|
1292
|
-
scrollbarWidth?: all | string | number;
|
|
1293
1293
|
scrollBehavior?: all | scrollBehavior;
|
|
1294
1294
|
scrollMargin?: all | number | string;
|
|
1295
1295
|
scrollMarginTop?: all | number | string;
|
|
@@ -1320,7 +1320,8 @@ export type CSSProperties = Readonly<{
|
|
|
1320
1320
|
scrollTimelineAxis?: all | 'block' | 'inline' | 'x' | 'y';
|
|
1321
1321
|
scrollTimelineName?: all | string;
|
|
1322
1322
|
scrollbarColor?: all | color;
|
|
1323
|
-
|
|
1323
|
+
scrollbarGutter?: all | 'auto' | 'stable' | 'stable both-edges';
|
|
1324
|
+
scrollbarWidth?: all | 'auto' | 'thin' | 'none';
|
|
1324
1325
|
shapeImageThreshold?: all | shapeImageThreshold;
|
|
1325
1326
|
shapeMargin?: all | shapeMargin;
|
|
1326
1327
|
shapeOutside?: all | shapeOutside;
|
|
@@ -1413,4 +1414,5 @@ export type CSSProperties = Readonly<{
|
|
|
1413
1414
|
wordWrap?: all | wordWrap;
|
|
1414
1415
|
writingMode?: all | writingMode;
|
|
1415
1416
|
zIndex?: all | zIndex;
|
|
1417
|
+
zoom?: all | 'normal' | number | string;
|
|
1416
1418
|
}>;
|
|
@@ -239,6 +239,7 @@ type display =
|
|
|
239
239
|
| 'inline-flex'
|
|
240
240
|
| 'grid'
|
|
241
241
|
| 'inline-grid'
|
|
242
|
+
| '-webkit-box'
|
|
242
243
|
| 'run-in'
|
|
243
244
|
| 'ruby'
|
|
244
245
|
| 'ruby-base'
|
|
@@ -474,7 +475,7 @@ type MsOverflowStyle =
|
|
|
474
475
|
| '-ms-autohiding-scrollbar';
|
|
475
476
|
type objectFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
476
477
|
type objectPosition = string;
|
|
477
|
-
type opacity = number;
|
|
478
|
+
type opacity = number | string;
|
|
478
479
|
type order = number;
|
|
479
480
|
type orphans = number;
|
|
480
481
|
type outline = string;
|
|
@@ -1362,7 +1363,6 @@ export type CSSProperties = $ReadOnly<{
|
|
|
1362
1363
|
mathShift?: all | 'normal' | 'compact',
|
|
1363
1364
|
mathStyle?: all | 'normal' | 'compact',
|
|
1364
1365
|
|
|
1365
|
-
scrollbarWidth?: all | string | number,
|
|
1366
1366
|
scrollBehavior?: all | scrollBehavior,
|
|
1367
1367
|
|
|
1368
1368
|
scrollMargin?: all | number | string,
|
|
@@ -1398,7 +1398,8 @@ export type CSSProperties = $ReadOnly<{
|
|
|
1398
1398
|
scrollTimelineName?: all | string,
|
|
1399
1399
|
|
|
1400
1400
|
scrollbarColor?: all | color,
|
|
1401
|
-
|
|
1401
|
+
scrollbarGutter?: all | 'auto' | 'stable' | 'stable both-edges',
|
|
1402
|
+
scrollbarWidth?: all | 'auto' | 'thin' | 'none',
|
|
1402
1403
|
|
|
1403
1404
|
shapeImageThreshold?: all | shapeImageThreshold,
|
|
1404
1405
|
shapeMargin?: all | shapeMargin,
|
|
@@ -1502,4 +1503,6 @@ export type CSSProperties = $ReadOnly<{
|
|
|
1502
1503
|
wordWrap?: all | wordWrap,
|
|
1503
1504
|
writingMode?: all | writingMode,
|
|
1504
1505
|
zIndex?: all | zIndex,
|
|
1506
|
+
|
|
1507
|
+
zoom?: all | 'normal' | number | string,
|
|
1505
1508
|
}>;
|
package/lib/StyleXTypes.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ type CSSPropertiesWithExtras = Partial<
|
|
|
55
55
|
'::spelling-error': CSSProperties;
|
|
56
56
|
'::target-text': CSSProperties;
|
|
57
57
|
'::-webkit-scrollbar'?: CSSProperties;
|
|
58
|
+
'::-webkit-scrollbar-button'?: CSSProperties;
|
|
59
|
+
'::-webkit-scrollbar-thumb'?: CSSProperties;
|
|
60
|
+
'::-webkit-scrollbar-track'?: CSSProperties;
|
|
61
|
+
'::-webkit-scrollbar-track-piece'?: CSSProperties;
|
|
62
|
+
'::-webkit-scrollbar-corner'?: CSSProperties;
|
|
63
|
+
'::-webkit-resizer'?: CSSProperties;
|
|
58
64
|
// webkit styles used for Search in Safari
|
|
59
65
|
'::-webkit-search-decoration'?: CSSProperties;
|
|
60
66
|
'::-webkit-search-cancel-button'?: CSSProperties;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexjs/stylex",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A library for defining styles for optimized user interfaces.",
|
|
5
5
|
"main": "./lib/stylex.js",
|
|
6
6
|
"module": "./lib/es/stylex.mjs",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"utility-types": "^3.10.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@stylexjs/scripts": "0.5.
|
|
49
|
+
"@stylexjs/scripts": "0.5.1"
|
|
50
50
|
},
|
|
51
51
|
"jest": {},
|
|
52
52
|
"files": [
|