• Hi everybody!

    I’d like to know if there is any support (already implemented or pending) for media queries. I’d like to be able to change font size scale for different screen sizes and in general all variables from theme.json.

    Now I’m using media queries in the style.css but adding manually the same scales seems very inefficient. If there is a different approach proposed by the new block approach let me know please!

    Thanks in advanced

Viewing 4 replies - 1 through 4 (of 4 total)
  • Are you using a premium theme or a custom theme ?

    Thread Starter luishporras

    (@luishporras)

    I’m coding a theme : )

    • This reply was modified 1 year, 9 months ago by luishporras.

    Hi @luishporras .. I don’t know if you’re still looking for a solution. However, the default TwentyTwentyThree theme uses a “fluid” setting to scale font sizes. I guess it works similar to clamp(). Maybe that helps in your situation.

    Thread Starter luishporras

    (@luishporras)

    (Update) What I was looking for was some kind of extra parameter in theme.json that allowed me to change variables values conditioned to screen size, I haven’t found something like that.

    @ehtmlu I’ve seen that but a clamp wouldn’t be enough (at least I don’t know how) to keep up with the huge difference between mobile and desktop, also keep in mind that maybe some text’s change a lot in size while others don’t.

    Instead I’ve decided that I was not using a proper approach to develop a fully custom theme, since I needed some ad-hock custom blocks and I was trying to implement everything using core blocks and changing its styles and adding some javascript (madness). So, instead of creating a plugin with my custom blocks (where you have complete freedom but also it’s a bit more tedious to develop), with the initial guidance of the course: Become a WordPress developer (which contains a chapter on block-themes), I’ve included custom blocks inside the theme. This seems to be a great approach to me although the documentation in www.ads-software.com is focused on plugin development (it really doesn’t change anything) and also mixes old implementations with new ones, so keep an eye.

    I’ll share the theme when I finish it in case it could be useful for others, thanks for the response!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Block theme support for media queries’ is closed to new replies.