4 votes

Blocks should allow use of theme/user styles

I noticed that as of now (10/2021) the blocks have one significant deficiency: they generate too much inline css. Some options can be inherited from the theme, like fonts, font-sizes etc., so someone might not see it. But apart of that, there embedded margins and paddings, other styling optinos etc. This is done at option level: if you leave option null (w/o value), then the option is inherited from the theme. However, there are dozens of options, which do not even allow entering null value, or require specific range of values (even the highest one). Paddings and margins are the most important. And those paddings and margins also create additional and often unnecessary DOM-node levels. Besides, with many options there is a bug, that when you make it Null, the default Kadence blocks value is still taken (like div margins of 25px), or sometimes the styles produced by the theme contain nulled styles (margin: in the stylesheet). Trying to fix this with the help of user- or theme- styles increases page load time, as more styles and DOM nodes need to be processed. I would suggest that you recheck all the options in the all the blocks, and implement the unified approach for all blocks: if any styling option (incl. margins, paddings etc.) is not defined (i.e. is null), then it is missed from the block inline styles, and then the developer must provide his own style, including generic theme styles. p.s. All the rest is nearly perfect!)
krasnoukhoff shared this idea

Leave a Reply