neve icon indicating copy to clipboard operation
neve copied to clipboard

Allow custom breakpoints

Open abaicus opened this issue 5 years ago • 7 comments

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.

abaicus avatar Jan 04 '21 04:01 abaicus

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

cristian-ungureanu avatar Feb 14 '22 11:02 cristian-ungureanu

@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

abaicus avatar Feb 14 '22 12:02 abaicus

Starting from this article I got to this plugin.

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

cristian-ungureanu avatar Jul 05 '22 14:07 cristian-ungureanu

@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

abaicus avatar Jul 06 '22 07:07 abaicus

+1 https://wordpress.org/support/topic/neve-how-to-change-breakpoint/

stefan-cotitosu avatar Jun 13 '23 15:06 stefan-cotitosu