How would you make editor buttons styles align with frontend
Styles in resources/views/blocks/button.theme.js, where these styles are applied. Cannot find anywhere.
$sizes array (xs, sm, base, lg) in resources/views/components/button.blade.php. I should be able to select size in editor for button? Cannot find this place, can only see typography size dropdown.
It should be fairly close, you might need to set the background and text colors
These are now correctly applied to the theme.json styles with the change I linked above, thank you for finding this bug!
The typography sizes should be applying classes that already had the same appropriate styles from Tailwind via our Vite plugin, but I’ve refactored that here: https://github.com/roots/radicle/pull/244 —want to give this a shot?
I quess you just need to set css manually. No good automatic solution to add relevant tailwind class to editor aswell and then you need tailwind also there. Im acutally using bootstrap5, so no good way somehow automatically.
Yes works. Quess I would rather add new dropdown for buttons size on editor side. Would rather not have it under typography, as font size might be same for all sizes, only padding is different.
If not too much effort then maybe example how you would handle dynamic block? For example latest cpt items with some attributes on editor to show/hide read more for example.
The way I dit it atm I still registered new block with js registerBlockType and added attributes there. Then in BlocksServiceProvider passed attributes to blocks/latest.blade.php and in blade added all stuff: ran some logic inside @php@endphp and html markup in the end.
#1 - It might be better to make a first party button block to have better control over the block markup instead of trying to modify the core button block
#3 - That makes sense, and we could add support for it by adding a higher-order component to override the core button’s UI for adding a dropdown with the size options. Similar to #1, I hadn’t considered this because I didn’t want to change core behavior, but I’ll think about this some more before the next release