gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Can the breakpoint value be changed?

Open s56bouya opened this issue 6 years ago • 5 comments

HI.

I'm Japanese WordPress theme developer. I made an issue here for the first time.

Can I change the value of each breakpoint using a hook?

https://github.com/WordPress/gutenberg/blob/c650280/editor/assets/stylesheets/_variables.scss#L104-L109

I think the breakpoint numbers should be flexible.

s56bouya avatar Jan 07 '20 12:01 s56bouya

Hi there! Thanks for opening the issue.

Could you detail why you think this should be flexible?

And no, that's not possible, media queries can't be dynamic even using CSS variables. I have a hard time imagining a technical solution that could allow these to be changed at runtime.

youknowriad avatar Jan 13 '20 13:01 youknowriad

Hi.

Thank you for your reply.

I have the following idea.

With so many websites around the world, the appropriate breakpoint numbers may not be consistent. I think it's better to be flexible, rather than fixed, so that I can specify the best breakpoints for each website.

In my example, the 600px CSS property is not needed, but it is needed if the unwanted property is applied at 769px.

I don't want to overwrite the 769px with the 600px CSS property, as that adds code and complicates design and management.

I'm glad if the system can change the breakpoint value flexibly with hooks.

s56bouya avatar Jan 17 '20 06:01 s56bouya

@s56bouya

What about overriding the applied CSS, such as gutenberg_register_packages_styles?

https://github.com/WordPress/gutenberg/blob/e33a49f691e60685bf2553095fd2edac860a535b/lib/client-assets.php#L303

@wordpress/base-styles may be useful.

torounit avatar Jan 17 '20 07:01 torounit

The breakpoints in Gutenberg are important for the admin essentially and potentially some blocks. I guess you want to override the block ones since that's where the design of the website comes in. Unfortunately, it's not technically possible to do so with the hook. You should consider providing your own CSS overrides.

youknowriad avatar Jan 17 '20 09:01 youknowriad

@torounit

Thanks.

How should I use it ... is there a reference article?

s56bouya avatar Jan 17 '20 09:01 s56bouya