Timeline for Block content rendered with inline CSS. How do I reuse it in a headless setup?
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 14, 2024 at 18:02 | vote | accept | ᴍᴇʜᴏᴠ | ||
| Nov 14, 2024 at 18:02 | answer | added | ᴍᴇʜᴏᴠ | timeline score: 1 | |
| Nov 9, 2024 at 22:06 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
| Jul 9, 2024 at 5:02 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
| Mar 10, 2024 at 9:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
| Nov 8, 2023 at 13:08 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
| Oct 5, 2023 at 12:06 | answer | added | J_Everhart383 | timeline score: 0 | |
| Apr 13, 2023 at 10:18 | comment | added | Tom J Nowell♦ | some of those controls will introduce HTML classes, some will introduce inline styles, the latter could be eliminated in favor of block styles which use classes. Classes that you then implement on the client side, bypassing the problem. Which controls those are I do not know off the top of my head, and for some that suggestion may not resolve the problem. Note again that these are comments, not answers, and I have not written a solution/answer to your question, just trying to be helpful. | |
| Apr 13, 2023 at 8:50 | comment | added | ᴍᴇʜᴏᴠ | @TomJNowell I understood that theme.json can be used to e.g. disable the custom colours, as well as any other controls. So by saying eliminating those controls, do you mean I should remove the ability to create these grids etc. that come with the block editor, and then reintroduce some custom grids instead? And because I will have to make the styling for these custom grids, I will control where it is located, so I will be able to reuse the same CSS in both admin editor as well as externally? | |
| Apr 12, 2023 at 20:15 | comment | added | ᴍᴇʜᴏᴠ | @TomJNowell reading up on Global Settings & Styles (theme.json), thank you for pointing me | |
| Apr 12, 2023 at 19:37 | comment | added | Tom J Nowell♦ | note that if you're setting individual options on specific blocks that are unique to that block there's a high chance some inline styling might be generated. While I don't have an answer for generating global styles output in a REST response which is the most direct answer to your question, you do have the option of eliminating those controls via theme.json, then registering block styles. This way the block style would have all that styling attached, and you'd just have a HTML class to implement in CSS in your client app/site, sidestepping the problem entirely | |
| Apr 12, 2023 at 19:17 | history | edited | ᴍᴇʜᴏᴠ | CC BY-SA 4.0 | added 91 characters in body |
| Apr 12, 2023 at 19:12 | history | asked | ᴍᴇʜᴏᴠ | CC BY-SA 4.0 |