Skip to content

Commit 6cf50f5

Browse files
committed
Add style notes and StyleSheet(...styles) API
1 parent 0a676db commit 6cf50f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

proposals/0000-reduce-fragmentation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ srcList.forEach((src) => {
363363

364364
# Styles API (CSS subset)
365365

366+
The styling capabilities of React Native should be significantly expanded to cover more of the features that are heavily relied upon by web engineers. Furthermore, React Native needs to gracefully handle unknown style properties or values as is expected on the web. Rather than hard crashing it could print warnings to bring attention to any styles that are not currently supported on native.
367+
366368
## StyleSheet
367369

368370
* [ ] Deprecate `StyleSheet.absoluteFill`. Use `position:'absolute';inset:0;` instead.
@@ -371,6 +373,7 @@ srcList.forEach((src) => {
371373
* [ ] Deprecate `StyleSheet.flatten()`. This API encourages runtime introspection of styles in render calls. This pattern is a performance cost (flattening arrays of objects), and prevents us from supporting build-time optimizations for web (e.g., extracting styles to CSS files).
372374
* [ ] Deprecate or rename `setStyleAttributePreprocessor` (e.g., `unstable_setStyleAttributePreprocessor`).
373375
* [ ] `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+
* [ ] `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.
374377

375378
## CSS compatibility
376379

@@ -386,7 +389,7 @@ srcList.forEach((src) => {
386389
* [ ] `textShadow`. Add native support for CSS text shadows.
387390
* [x] `transform`. Support using string values to set transforms.
388391
* [x] `verticalAlign` is equivalent to `textAlignVertical`.
389-
* [ ] `visiblity`. Add support for visually hiding elements.
392+
* [ ] `visibility`. Add support for visually hiding elements.
390393
* [x] `userSelect`. Equivalent to using `selectable` prop on `<Text>`.
391394

392395
## CSS Logical Properties

0 commit comments

Comments
 (0)