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

Allow custom breakpoints #2439

Open
abaicus opened this issue Jan 4, 2021 · 6 comments
Open

Allow custom breakpoints #2439

abaicus opened this issue Jan 4, 2021 · 6 comments
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project

Comments

@abaicus
Copy link
Collaborator

abaicus commented Jan 4, 2021

Description:

Allow the user to set custom responsive breakpoints. This can be achieved easily right now using CSS variables.

Alternatives:

Don't allow custom breakpoints definition.

@cristian-ungureanu
Copy link
Contributor

This is the most voted request on Nolt, I think we should implement it.

@cristian-ungureanu cristian-ungureanu added the enhancement Request to improve or optimize an existing feature or functionality in the project label Feb 14, 2022
@abaicus
Copy link
Collaborator Author

abaicus commented Feb 14, 2022

@cristian-ungureanu media queries don't support custom properties. This is a thing that I wasn't aware of when I posted this.

A workaround would be to rewrite the CSS on the user's website each time these change, but I doubt it's worth the hassle.

https://www.w3.org/TR/css-variables-1/#using-variables

@cristian-ungureanu
Copy link
Contributor

Starting from this article I got to this plugin.

@abaicus maybe you can have a look over this, maybe we could use it. 🤔

@abaicus
Copy link
Collaborator Author

abaicus commented Jul 6, 2022

@cristian-ungureanu

@custom-media directives are in the draft spec for now here 🔗.

PostCSS is a dev tool that runs during the build phase and transforms CSS using JS. The postcss-custom-media plugin does just that. It can be useful in the same way we use SCSS variables 🔗 to not constantly repeat the same numbers and potentially get them wrong between usages.

Here is a CodePen 🔗 that showcases what happens when custom media queries get passed through PostCSS and the postcss-custom-media plugin.

PostCSS Custom Media

@stefan-cotitosu
Copy link
Contributor

@rodica-andronache
Copy link
Contributor

In this case, from what I’ve seen in tickets across time, the main thing that people want is to control the header ( especially the menu/menu icon ) on tablets, or on larger phones. Right now, on tablet you get the header you set up for mobile (the menu icon), even though there should be space to have the full menu.

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
Projects
None yet
Development

No branches or pull requests

4 participants