Skip to content

Commit 2134f0d

Browse files
author
Justin Boyson
authored
Allow px for margin, padding, height, & width (#200)
* Allow px for margin, padding, height, & width Forcing font-based sizing onto non-font-based elements is a mistake. This article does a great job of explaining why: https://medium.com/@sascha.wolff/dont-use-rem-em-for-paddings-margins-and-more-94e19026b000 This PR adds `px` as an available unit for margin, padding, height, & width.
1 parent dd09bda commit 2134f0d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.stylelintrc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"/^border(?!.*-radius$)/": ["px", "%"],
1818
"/^border-radius/": ["px", "rem", "%"],
1919
"/^box-shadow": ["px"],
20-
"/^margin/": ["rem"],
21-
"/^padding/": ["rem"],
20+
"/^margin/": ["rem", "px"],
21+
"/^padding/": ["rem", "px"],
2222
"font-size": ["rem", "em"],
23-
"height": ["rem", "%", "vh"],
24-
"width": ["rem", "%", "vw"]
23+
"height": ["rem", "%", "vh", "px"],
24+
"width": ["rem", "%", "vw", "px"]
2525
},
2626
"max-empty-lines": 1,
2727
"no-duplicate-selectors": true,

0 commit comments

Comments
 (0)