You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/0000-reduce-fragmentation.md
+59-21Lines changed: 59 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -375,26 +375,21 @@ The styling capabilities of React Native should be significantly expanded to cov
375
375
*[ ]`StyleSheet.create()` should obfuscate styles to prevent introspection (i.e., revert identify function change). On web, we need to be able to remove the JavaScript style objects from bundles to support build-time optimization like extraction to CSS files.
376
376
*[ ]`StyleSheet` should be a function that returns native props, e.g., `const nativeProps = StyleSheet(...styles)`. On web, this is used to pass DOM `className` and `style` props, whereas on native it can be used to pass flattened/transformed styles and any other other native props to native components.
377
377
378
-
## CSS compatibility
378
+
## CSS Compatibility
379
+
380
+
Existing properties that can be adjusted to align with the CSS spec.
379
381
380
382
*[x]`aspectRatio`. Support string values, i.e., `'16 / 9'`, to align with CSS.
381
-
*[ ]`backgroundImage`. Add support for setting background images via `url()`. Stretch: support CSS gradients.
382
-
*[ ]`boxShadow`. Add native support for CSS box shadows to replace buggy, iOS-specific `shadow*` styles.
383
383
*[x]`fontVariant` support space-separated string values to align with CSS.
384
384
*[x]`fontWeight` support number values to align with React DOM / CSS.
385
-
*[ ]`lineClamp` is equivalent to `numberOfLines` prop on `<Text>` components.
386
385
*[x]`objectFit` is equivalent to `resizeMode` for `<Image>`.
387
386
*[x]`pointerEvents` is equivalent to `pointerEvents` prop.
388
387
*[ ]`position`. Support for `fixed` and `sticky` values.
389
-
*[ ]`textShadow`. Add native support for CSS text shadows.
390
388
*[x]`transform`. Support using string values to set transforms.
391
389
*[x]`verticalAlign` is equivalent to `textAlignVertical`.
392
-
*[ ]`visibility`. Add support for visually hiding elements.
393
390
*[x]`userSelect`. Equivalent to using `selectable` prop on `<Text>`.
394
391
395
-
## CSS Logical Properties
396
-
397
-
Support CSS logical property names, i.e., `paddingInlineStart` rather than only non-standard `paddingStart`. Support subtree-level logical properties, where setting the `dir` prop to `ltr` or `rtl` alters the way logical properties are resolved. Currently, React Native only supports global writing direction configuration for Android.
392
+
Existing logical properties that can be adjusted to adopt the CSS standard names. In addition, React Native will need to add native support for subtree-level writing direction controls. Setting the `dir` prop (or `direction` style) to `ltr` or `rtl` on an element should alter the way logical properties are resolved in the subtree.
398
393
399
394
*[ ]`direction` is equivalent to `writingDirection`.
400
395
*[ ]`borderEndEndRadius` is equivalent to `borderBottomEndRadius`.
@@ -439,24 +434,18 @@ Support CSS logical property names, i.e., `paddingInlineStart` rather than only
439
434
*[ ]`insetInlineEnd` is equivalent to `right` or `left`.
440
435
*[ ]`insetInlineStart` is equivalent to `right` or `left`.
441
436
442
-
## CSS Lengths
443
-
444
-
Support major units where supported by CSS.
445
-
446
-
*[ ]`em` units.
447
-
*[ ]`rem` units.
448
-
*[ ]`px` units.
449
-
*[ ]`v*` units.
450
-
*[ ]`%` units.
451
-
452
437
## CSS Animations
453
438
454
-
Support declarative keyframes and animations that can be optimized on the native side and avoid the need for `Animated`. See [animation](https://developer.mozilla.org/en-US/docs/Web/CSS/animation)).
439
+
Support declarative keyframes and animations that can be optimized on the native side and avoid the need for `Animated`. Consider dispatching the corresponding W3C animation events too. See [animation](https://developer.mozilla.org/en-US/docs/Web/CSS/animation)).
455
440
456
441
## CSS Colors
457
442
458
443
Support CSS 4 Colors using [Colorjs.io](https://colorjs.io/).
459
444
445
+
## CSS Container Queries
446
+
447
+
Prepare for [CSS Container Queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries).
448
+
460
449
## CSS Custom Properties
461
450
462
451
Support CSS custom property syntax `--variable-name`. This could be shimmed in user-space on top of the existing `StyleSheet` API, with a React Context used to provide variables and values to a subtree.
@@ -465,13 +454,62 @@ Support CSS custom property syntax `--variable-name`. This could be shimmed in u
465
454
466
455
Support declarative filters as used by the CSS [filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) style.
Support CSS Media Queries. Although Media Queries are not a preferred long-term solution, [Container Queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries) are not yet widely supported by browsers. This could be shimmed in user-space on top of the existing `StyleSheet` API.
471
480
481
+
## CSS Properties and Values
482
+
483
+
Miscellaneous CSS properties and values that should be supported on native.
484
+
485
+
*[ ]`backgroundImage`. Add support for setting background images via `url()`. Stretch: support CSS gradients.
486
+
*[ ]`boxSizing`.
487
+
*[ ]`boxShadow`. Add native support for CSS box shadows to replace buggy, iOS-specific `shadow*` styles.
488
+
*[ ]`caretColor`.
489
+
*[ ]`clipPath`.
490
+
*[ ]`display` values of `block`, `inline`, `inline-block`, `inline-flex`.
491
+
*[ ]`float`.
492
+
*[ ][`justifySelf`](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self). Sets the way a box is justified inside its alignment container along the appropriate axis.
493
+
*[ ] (`lineClamp` is equivalent to `numberOfLines` prop on `<Text>` components).
*[ ][`placeContent`](https://developer.mozilla.org/en-US/docs/Web/CSS/place-content). Shorthand for setting `alignContent` and `justifyContent`. Value is an enum of `baseline`, `first baseline`, `last baseline`, `center`, `end`, `flex-start`, `flex-end`, `left`, `right`, `safe`, `space-around`, `space-between`, `space-evenly`, `start`, `stretch`, `unsafe`. Note that `space-evenly` should also be supported for `alignContent` and `justifyContent`.
500
+
*[ ][`placeItems`](https://developer.mozilla.org/en-US/docs/Web/CSS/place-items). Shorthand for setting `alignItems` and `justifyItems`. Value is an enum of `auto`, `baseline`, `first baseline`, `last baseline`, `center`, `end`, `flex-start`, `flex-end`, `left`, `right`, `start`, `stretch`.
501
+
*[ ][`placeSelf`](https://developer.mozilla.org/en-US/docs/Web/CSS/place-self). Shorthand for setting `alignSelf` and `justifySelf`. Value is an enum of `auto`, `baseline`, `first baseline`, `last baseline`, `center`, `end`, `flex-start`, `flex-end`, `left`, `normal`, `right`, `start`, `stretch`.
Support declarative transitions that can be optimized on the native side and avoid the need for `Animated`. Support `transitionProperty`, `transitionDuration`, `transitionTimingFunction`, and `transitionDelay` styles (see [transition](https://developer.mozilla.org/en-US/docs/Web/CSS/transition)).
512
+
Support declarative transitions that can be optimized on the native side and avoid the need for `Animated`. Support `transitionProperty`, `transitionDuration`, `transitionTimingFunction`, and `transitionDelay` styles (see [transition](https://developer.mozilla.org/en-US/docs/Web/CSS/transition)). Consider dispatching the corresponding W3C transition events too.
0 commit comments