liip / bootstrap-blocks-wordpress-plugin

Bootstrap Gutenberg Blocks for WordPress
https://wordpress.org/plugins/wp-bootstrap-blocks/
279 stars 60 forks source link

Support Color Settings #109

Open janwidmer opened 2 years ago

janwidmer commented 2 years ago

Default Gutenberg Components offer the option to set a font / background color. This widget is offered by gutenberg and can also be implemented for custom blocks, see https://awhitepixel.com/blog/how-to-add-color-settings-to-your-custom-gutenberg-block/

It would be great, if this block could also support the colors widget.

tschortsch commented 2 years ago

Thanks for bringing in this idea. But I think there could be an issue with using the colors defined in WordPress. I don't think they would match the color names of your bootstrap setup (like primary, secondary, ...). That's why we created it as a separate list of colors (which can be extended via a filter). But maybe I'm missing something (?)

alahmnat commented 2 years ago

I second this request.

At the very least, reading in the theme colors would be beneficial, because at least for the sites I build, I don't tend to mess around with the default colors for Bootstrap in the package itself. I also don't use Bootstrap's primary/default/etc. style conventions when building block-level elements. All that stuff lives in its own definitions and draws off of WordPress's theme palette whenever possible, because everything else in Gutenberg is geared toward it.

For now I'm getting around this by adding a group element inside the column, setting the column's padding to 0, and adding the padding and background color to the group instead. It would be nice to do away with that extra element, though.

stevenbrown-85 commented 1 year ago

+1 for this - having bootstrap defaults and being able to set custom colors would be great

r3volution11 commented 5 months ago

Another +1. I just installed and I was hoping to change the built-in colors for the primary and secondary by simply defining them again in block-filters.js. No luck, no I just have duplicates.