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

Re-use media query sizes as variables? #563

Open
Siilwyn opened this issue Jan 31, 2023 · 0 comments
Open

Re-use media query sizes as variables? #563

Siilwyn opened this issue Jan 31, 2023 · 0 comments

Comments

@Siilwyn
Copy link
Member

Siilwyn commented Jan 31, 2023

Would be nice to put the breakpoints we use in one place and re-use them in both the templates for image sizes and the styling for media queries.

One option would be using CSS Modules @value, it's supported by Vue SFC out of the box. Made a quick POC using one component as example: https://github.com/voorhoede/voorhoede-website/tree/use-query-variables
Not sure if this is the way to go though as it requires changing the way we use classes.

Otherwise we'll have to look into using a custom PostCSS plugin like https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-custom-media, and figure out how to use variables in templating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant