Skip to content

Commit 2ae4db3

Browse files
Update the unit-less property map (#49)
1 parent a18bc03 commit 2ae4db3

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.changeset/wicked-carrots-turn.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@vanilla-extract/css': patch
3+
---
4+
5+
Update the unit-less property map
6+
7+
The original list was borrowed from the [postcss-js parser](https://github.com/postcss/postcss-js/blob/d5127d4278c133f333f1c66f990f3552a907128e/parser.js#L5), but decided to reverse engineer an updated list from [csstype](https://github.com/frenic/csstype) for more thorough coverage.

packages/css/src/transformCss.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,50 @@ import { validateSelector } from './validateSelector';
1717
import { forEach, omit, mapKeys, isEqual } from './utils';
1818

1919
const UNITLESS: Record<string, boolean> = {
20+
animationIterationCount: true,
21+
borderImage: true,
22+
borderImageOutset: true,
23+
borderImageSlice: true,
24+
borderImageWidth: true,
2025
boxFlex: true,
2126
boxFlexGroup: true,
2227
columnCount: true,
28+
columns: true,
2329
flex: true,
2430
flexGrow: true,
25-
flexPositive: true,
2631
flexShrink: true,
27-
flexNegative: true,
2832
fontWeight: true,
33+
gridArea: true,
34+
gridColumn: true,
35+
gridColumnEnd: true,
36+
gridColumnStart: true,
37+
gridRow: true,
38+
gridRowEnd: true,
39+
gridRowStart: true,
40+
initialLetter: true,
2941
lineClamp: true,
3042
lineHeight: true,
43+
maxLines: true,
3144
opacity: true,
3245
order: true,
3346
orphans: true,
3447
tabSize: true,
48+
webkitLineClamp: true,
3549
widows: true,
3650
zIndex: true,
3751
zoom: true,
52+
53+
// svg properties
3854
fillOpacity: true,
55+
floodOpacity: true,
56+
maskBorder: true,
57+
maskBorderOutset: true,
58+
maskBorderSlice: true,
59+
maskBorderWidth: true,
60+
shapeImageThreshold: true,
61+
stopOpacity: true,
3962
strokeDashoffset: true,
63+
strokeMiterlimit: true,
4064
strokeOpacity: true,
4165
strokeWidth: true,
4266
};

0 commit comments

Comments
 (0)