Skip to content
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

[Feature]: Add an "Additional Styles" prop #24577

Closed
aristath opened this issue Aug 14, 2020 · 1 comment
Closed

[Feature]: Add an "Additional Styles" prop #24577

aristath opened this issue Aug 14, 2020 · 1 comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.

Comments

@aristath
Copy link
Member

aristath commented Aug 14, 2020

We have an Additional CSS class(es) field where authors can add additional classes. That option however, opened the door to plugin & theme-developers to add lots of cool things in their products. For example they can (and do) add their custom panel with a couple of switches. Internally all these switches do is toggle some extra classes.
If we switch to the code editor and manually add some classes to a block, when we switch back to the visual editor the classes exist in the Additional CSS class(es) field and nothing breaks.

The problem is when we try to do something similar with CSS: If we try to manually add some simple styles in the pre-existing style prop in the code editor, when switching back to the visual editor the block breaks.
I would like to see an Additional CSS styles field, similar to what we do for the css-classes.
As a user, it would allow me to build custom designs lot easier and faster. Instead of resorting to an HTML block whenever we want to do something slightly different, we'd be able to use existing blocks and just add inline styles to it.
As a plugin & theme developer that would also be a game-changer, we'd be able to build smarter implementations and extend the editor.
No breakage, no backwards-compatibility issues, and another important benefit would be that the editor won't break if someone deactivates a plugin that was adding styles (which is what happens right now for some plugins I've seen)

@annezazu annezazu added [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement. CSS Styling Related to editor and front end styles, CSS-specific issues. labels Aug 14, 2020
@mtias
Copy link
Member

mtias commented Aug 30, 2020

Consider this is one of the main objectives of #20331. Styles need to be codified as special attributes, though, otherwise they become too opaque.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants