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
Hi 👋, commit 5c684e6 changed the normalize mixin to return a 2-object array of styles. Currently, it's compatible with emotionjs and styled-components template literals but doesn't seem to work with object styles unless used as follows:
conststyles={ ...normalize()[0]};
Is this the intended use of normalize with object styles?
The text was updated successfully, but these errors were encountered:
@alexbrt The reason for that change was to properly handle the fallback needed for 'abbr[title]''s textDecoration property. To make the current implementation work with object notation you will need to get creative depending on the library you are using. For example, the following should work with emotion and jss: https://cssinjs.org/jss-syntax/?v=v10.4.0#fallbacks
Unfortunately, object notation fallbacks don't work the same way in styled-components: styled-components/styled-components#3135 or React itself: facebook/react#2020. Without extra processing, the fallback will just get overwritten. The way you are currently doing it will ignore the value provided in the second array and always use the fallback value. This is probably safe as it is the only property and the difference between the "preferred" value and the fallback is minimal.
Question
Hi 👋, commit 5c684e6 changed the
normalize
mixin to return a 2-object array of styles. Currently, it's compatible withemotionjs
andstyled-components
template literals but doesn't seem to work with object styles unless used as follows:Is this the intended use of
normalize
with object styles?The text was updated successfully, but these errors were encountered: