Block styles are hard

The next plugin I’m launching is one that adds fun button styles. One thing that bothers me about clean/minimalistic design is everything blends in too much. People create buttons to be clicked on and no one clicks on boring buttons.

My goal was to add new block styles to the exist core button block but it ended up being a disaster. The way styles are done now is the default style is styled by the theme and for each additional style a class is added and you can add additional styling on top of that.

It’s no problem if you are trying to make small modifications. Wanna change the border style from solid to dashed, no problem. But for anything more complex you run into issues. You can override elements but you run into issues of specificity. Short of adding an !important to every element this is surprisingly hard.

Because of this I had to do something that hurt my soul, I created another button block. I know, I said block duplication should never be done but I really wanted my button styles to see the light of day and I didn’t know of any other way.

I don’t really know a good fix for this. If the block editor added the “.is_default” class to all buttons that don’t have a style and themers used that selector when styling buttons that would be great, but I don’t think it will happen. While buttons are probably the worst styles to override all core blocks will have this issue to some degree and it would be amazing if we could find a solution.

I would love to decouple design a bit from themes. There has to be a way to mix and match elements to get what you want. People want choice and I’d love to give it to them.

Stay connected