Closed itsdouges closed 6 months ago
Latest commit: 70b84e919098029341b8f8b05092087813b34c20
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Do requiredProperties, requiredPseudos work in nested @media rules—should they? Maybe they shouldn't actually…that'd be weird to require deep property overrides on every media rule…
Done, as discussed we'll remove the whole required pseudos in a follow up
isAtRuleObject logic
Let me fix now.
@kylorhall-atlassian check out the PR now thanks mate
This pull request introduces media query support to XCSS prop, and in turn changes some internals to make it function. Read on for the individual changes to each API.
cssMap changes
The CSS map API now allows defining top level media queries. Previously you had to define them inside a
@media
object, this restriction has now been removed bringing it inline with the CSS function API.Both APIs are still supported however only the top level definition will pass type checking with XCSS prop. In the future we'll remove support for the nested object.
For the strict API the default media query type is
@media ${never}
. Meaning, by default, no media queries are available. Yo can expand it to specific string values passing in a string literal union as the second generic arg.XCSS prop changes
The XCSS prop now takes top level media queries. Nested media queries is not allowed.
createStrictAPI changes
Now takes an optional second generic to define what media queries are supported:
Which is then flushed to all output APIs.