Skip to content

Commit b0db2aa

Browse files
committed
include notes on unitless props
1 parent 3292248 commit b0db2aa

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

content/docs/reference-dom-elements.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,36 @@ function HelloWorldComponent() {
9999
return <div style={divStyle}>Hello World!</div>;
100100
}
101101
```
102+
Sometimes you _do_ want to keep the CSS properties unitless. Here's a list of properties that won't get the automatic "px" suffix:
103+
104+
- `animationIterationCount`
105+
- `boxFlex`
106+
- `boxFlexGroup`
107+
- `boxOrdinalGroup`
108+
- `columnCount`
109+
- `fillOpacity`
110+
- `flex`
111+
- `flexGrow`
112+
- `flexPositive`
113+
- `flexShrink`
114+
- `flexNegative`
115+
- `flexOrder`
116+
- `fontWeight`
117+
- `lineClamp`
118+
- `lineHeight`
119+
- `opacity`
120+
- `order`
121+
- `orphans`
122+
- `stopOpacity`
123+
- `strokeDashoffset`
124+
- `strokeOpacity`
125+
- `strokeWidth`
126+
- `tabSize`
127+
- `widows`
128+
- `zIndex`
129+
- `zoom`
130+
131+
See [unitless properties](https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSProperty.js#L15-L59) for more examples.
102132

103133
### suppressContentEditableWarning
104134

0 commit comments

Comments
 (0)