-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TT1 Blocks: Button Block: Migrate CSS to theme.json #114
Comments
Some bits I've learnedIn order for Gutenberg to leverage the changes to theme.json found in #137 first Gutenberg needs to be changed. The BUTTON block consists of a DIV element that wraps an A. The bits that pick up the color configuration in the theme.json and make use of them in other blocks (such as group) appear to only operate on the outermost element of the block. (Classes and styles are added only there). The button doesn't make use of the same mechanism that blocks like the GROUP block use, it handles it on it's own. Called out copypasta which is sad indeed. The button block makes use of an So either
Additionally, WordPress/gutenberg#25791 might take care of the border radius but it likely will have the same problems that color has had. (I have not yet evaluated it.) This isn't an exhaustive list of what needs to be considered for changes to the button as the CSS for the theme covers the additional selectors and I'm not sure how that matters in regards to Gutenberg and the button block:
|
This brings up an interesting question actually. The reason these extra selectors are there is so that additional buttons can pick up the same styles. For example, the I'm not sure the best way to ensure that those blocks pick up the same styles as the default Button Block (but they should). |
Shouldn't they also implement their buttons as Button Blocks? |
It looks like it might be time to revisit the Button changes in #21266. @youknowriad do you think its worth giving that another go? Is there a better approach now? |
That would be great, but right now I don't think they do. |
I created an issue for it here: WordPress/gutenberg#27740 |
The code is here.
From #82
The text was updated successfully, but these errors were encountered: