DEV Community

Discussion on: WP Snippet #009 Custom Gutenberg font sizes

 
vanaf1979 profile image
Stephan Nijman

Haha. To bad.

But i was wondering why you can't use the class names to create responsive text sizes?

Thread Thread
 
azragh profile image
Daniel Geiser

I can, I have and it works, but the problem is that inline styles in the editor have to be overwritten with !important / inside the .editor-styles-wrapper parent class. So i really have to overwrite my own CSS with !important in a seperate stylesheet!? This feels extremely wrong considering that the styles / classes are already present and are only overwritten by the inline pixel values. Could lead to further problems in the cascade too .. My current solution is to calculate the corresponding pixel values matching my em's in CSS and then set them in editor_font_sizes to avoid unnecessary code, but this breaks mobile previews (I mostly have a smaller root font size on mobile devices).