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

[DevEx][Perf] Leverage PostCSS to implement shorthand media queries and ensure they are merged #3638

Open
abaicus opened this issue Sep 28, 2022 · 0 comments
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project performance & speed Performance and speed

Comments

@abaicus
Copy link
Collaborator

abaicus commented Sep 28, 2022

Description:

We can leverage postcss-custom-media and postcss-combine-media-query to improve the development experience with SCSS.

Right now, we're using a _media-queries.scss file with mixins to gather all media queries. This would help us inline everything in SCSS and also ensure that if there are any inlined media queries, these are merged for efficiency purposes.

Also, postcss-custom-media will ensure standardization and enable shorthands to make things easier and enable developers to not think if the media-query should be min-width or max-width every time.

For example

@media (min-width: #{$tablet})
// Will become 
@media (--tablet)

I've implemented this in Raft, and it seems to work quite well.

@abaicus abaicus added enhancement Request to improve or optimize an existing feature or functionality in the project low-priority performance & speed Performance and speed labels Sep 28, 2022
@selul selul removed the low-priority label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project performance & speed Performance and speed
Projects
None yet
Development

No branches or pull requests

2 participants