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

CSS Class Auto Suggestion #15077

Open
VR51 opened this issue Apr 19, 2019 · 5 comments
Open

CSS Class Auto Suggestion #15077

VR51 opened this issue Apr 19, 2019 · 5 comments
Labels
Customization Issues related to Phase 2: Customization efforts [Type] Enhancement A suggestion for improvement.

Comments

@VR51
Copy link

VR51 commented Apr 19, 2019

I think it would be useful for CSS classes added in a block's Advanced tab to be stored in the database and suggested for reuse whenever the Advanced tab is opened similar to the way categories are suggested. This would prevent authors entering wrong class names and would stop authors forgetting about classes that are available to use already.

image

Would this be easy to implement?

@Soean
Copy link
Member

Soean commented Apr 21, 2019

We have the concept of Block Styles in Gutenberg, they are based on classes. There are open issues about extending them, see #7551 and #9534.

@Soean Soean added the Customization Issues related to Phase 2: Customization efforts label Apr 21, 2019
@VR51
Copy link
Author

VR51 commented Apr 21, 2019

Cheers @Soean. I'll check the other open issues to see whether they discuss auto suggestions for previously used class names.

Edit. Those open issues are closer to where I anticipated my feature suggestion eventually leading; my intention was to open the conversation. I hadn't realised we were this far along -- I had a brief look before posting, though (wading through so many issues/requests/suggestions is not easy. Maybe we need an A1, A2 and Adopted tag for considered suggestions? 'A#' because A comes before B...). I can see those open issues working well as a CPT. I'll read through them and post there if appropriate.

Again, thank you.

@talldan talldan added the [Type] Enhancement A suggestion for improvement. label Jun 5, 2020
@00travelgirl00
Copy link

@Soean not everyone can use Block Styles, cause it requires PHP knowledge to create own block styles. Thats why we have the option for Additional CSS Classes, as CSS is more accessible for non Developers and Designers.

I really support the suggestion for showing extisting Custom CSS classes, as it would make it really easier to use custom classes!

@mrwweb
Copy link

mrwweb commented Oct 19, 2021

See also: #19367

@coreyworrell
Copy link
Contributor

I know this is old issue, but you can try using this plugin: https://wordpress.org/plugins/block-class-autocomplete/

It utilizes the PHP block-class-autocomplete/suggestions filter, so you can return an array of suggestions that will show in autocomplete.

block-class-autocomplete.mp4

There is an issue though in latest WP that completely changed the way the core input component was added, so now it is showing the default field and this custom field. They do sync, but I'm currently trying to figure out if that can be corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customization Issues related to Phase 2: Customization efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants