Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@custom-media intersections #277

Closed
argyleink opened this issue Sep 14, 2022 Discussed in #275 · 0 comments · Fixed by #279
Closed

@custom-media intersections #277

argyleink opened this issue Sep 14, 2022 Discussed in #275 · 0 comments · Fixed by #279
Labels
bug Something isn't working

Comments

@argyleink
Copy link
Owner

Discussed in #275

Originally posted by WebMechanic September 13, 2022
Hello,

we use @custom-media with the PostCSS plugin for or .scss files (Vite), and I was wondering about the reasoning behind intersecting values of the various *-only, *-n-below and *-n-above due to the use of <= and >=

@custom-media --lg-n-above (width >= 1024px);
@custom-media --lg-n-below (width <= 1024px);

transpiles into

@media (min-width: 1024px) ...
@media (max-width: 1024px) ...

Rulesets would then overlap at 1024px letting the cascade win which isn't always possible to control (not using @layer).

Maybe I'm missing the logic here, but wouldn't this be more accurate?

@custom-media --lg-n-above    (width >= 1024px);
@custom-media --lg-n-below    (width <  1024px);  // == (max-width: 1023px)

So, just curious.


In our copy we eventuall replaced all <= with < and also used more accurate/modern screensizes based on our analytics and matching our content's needs, not the (outdated) "iDevice" values even Apple no longer maintains.

@argyleink argyleink added the bug Something isn't working label Sep 14, 2022
argyleink added a commit that referenced this issue Sep 16, 2022
@argyleink argyleink linked a pull request Sep 16, 2022 that will close this issue
argyleink added a commit that referenced this issue Sep 19, 2022
* fixes #277

* updates sample vars in docsite
kelvindecosta pushed a commit to kelvindecosta/open-props that referenced this issue Nov 16, 2022
* fixes argyleink#277

* updates sample vars in docsite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant