You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we swapped to using css modules instead of emotion, when the bundle gets created any styles that can use a shorthand (eg margin) get convert to that format instead of using different properties. It works fine most times, but it breaks if there's no default value set on a prop.
We could say this is down to users to mind that on their apps but CSS modules doesn't merge the values in development mode so it's easy to miss. Tools should help with that but the morpher should ultimately ensure that any styles that can be shorthanded get a default to prevent these issues.
The text was updated successfully, but these errors were encountered:
Since we swapped to using css modules instead of emotion, when the bundle gets created any styles that can use a shorthand (eg margin) get convert to that format instead of using different properties. It works fine most times, but it breaks if there's no default value set on a prop.
Take this example:
marginLeft
has no default value.In production, CSS modules compiles it to:
Since
var(--marginLeft)
takesundefined
, the style breaks.Here's an example of the problem with raw HTML:
We could say this is down to users to mind that on their apps but CSS modules doesn't merge the values in development mode so it's easy to miss. Tools should help with that but the morpher should ultimately ensure that any styles that can be shorthanded get a default to prevent these issues.
The text was updated successfully, but these errors were encountered: