Size shorthand is overwriting an existing CSS property
See original GitHub issueI was mighty confused why my printing stylesheet wasn’t working, until I finally discovered that the size
property was being replaced with width
and height
.
size is a property used for defining @page size
I might recommend wh
as a shorthand instead, as it describes the format of the string to be passed, is shorter, and is generally more descriptive than size
. On top of not conflicting with an existing property.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Shorthand properties - CSS: Cascading Style Sheets | MDN
Shorthand properties are CSS properties that let you set the values of multiple other CSS properties simultaneously. Using a shorthand property ...
Read more >Overwriting transitioned CSS property via JS makes transition ...
This is happening because you're overriding the existing style by applying the style via style attribute on the HTML element.
Read more >Accidental CSS Resets
Any time you use a shorthand property in CSS, you set all the values for all the properties it deals with. It's not...
Read more >How to override the CSS properties of a class using another ...
To override the CSS properties of a class using another class, we can use the !important directive. In CSS, !important means “this is ......
Read more >The Shorthand-Longhand Problem in Atomic CSS
It's about CSS specificity, shorthand and longhand properties in CSS ... it will always prioritize the second overwriting the first styles.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is certainly helpful, though
@page
is meant to be used in the root styles, so currently the only workaround I’m aware of is:A workaround to use until we figure out how to solve this:
Opt out of shorthands withcss
prop. Style objects you pass tocss
go directly to Emotion, so we’re not transforming the shorthand.Edit: Better workaround in thecrowkeep’s post below ⬇