-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Table of contents block: add color block supports #43363
Conversation
Fixing the failing e2e test in this commit: 3ba738875c953c3381d5022ccd809ab9e537e5e2 |
f5aa5c2
to
67660ef
Compare
Interesting, looks like the schema doesn't support it. Perhaps it's intentional? |
ok, I guess that is another can we can kick down the road, it works in the UI so lets run with it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in the UI, but setting link
doesn't currently work in theme.json so that may need to be followed up at some point if that is an expectation.
Looks like the theme json class doesn't even look for it. There's no path in
My assumption is that is needs to be handled as an "element", similar to the way we're doing it for block supports in It doesn't work for any text block that I'm testing (para, heading)... |
I've added it as a follow up in #43245 |
Thanks for these PRs. 👍 |
I just remembered that most (if not all) text blocks with background color controls have additional styles to add padding when a background color is present... including the List block. I guess the same thing should happen here, though I imagine the exact styles couldn't just be copied over from the List block since in this case, the padding would be applied to the wrapping In the List block, this auto-padding would override any padding already set on the I actually considered making a PR to add color controls to the Table of Contents some months ago, but I got stuck trying to figure out what to do here. |
Thanks for raising this!
What if we didn't adding padding here? Using padding values one can achieve the same effect and have greater control: There's a related discussion about the extra padding given to blocks with background color (and whether it's a good thing at all) There is the question of classic themes. The above issue considers the use of classic-only stylesheet. |
Related:
What?
Enabling full color block supports for the Table of contents block
Why?
To create consistency across blocks.
How?
Adding the relevant block supports in block.json
Testing Instructions
Example block code