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

Show existing classes in "Advanced" #22895

Closed
00travelgirl00 opened this issue Jun 4, 2020 · 2 comments
Closed

Show existing classes in "Advanced" #22895

00travelgirl00 opened this issue Jun 4, 2020 · 2 comments
Labels
[Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed

Comments

@00travelgirl00
Copy link

Is your feature request related to a problem? Please describe.

I have added a own class to a block and added some CSS in the style.css to it. Couple days later I forgot about it and added a similar class for the same purpose to a block. I wanted to styl it in my style.css and realized I have already creadet a similar class.

Describe the solution you'd like

It would be great to view the already existing classes unter the field for "Additional CSS class(es)"

Bildschirmfoto 2020-06-04 um 16 36 20

@Soean
Copy link
Member

Soean commented Jun 4, 2020

If you want to use a style on different blocks, then block styles are a better solution.

Add a style via PHP:

register_block_style(
    'core/quote',
    array(
        'name'         => 'blue-quote',
        'label'        => __( 'Blue Quote' ),
    )
);

Add style to CSS

.wp-block-quote.is-style-blue-quote { 
    color: blue; 
}

Result
Bildschirmfoto 2020-06-04 um 21 03 37

@talldan
Copy link
Contributor

talldan commented Jun 5, 2020

Thanks for creating the issue @00travelgirl00, this was also suggested on #15077, so I'll close this as a duplicate.

@talldan talldan closed this as completed Jun 5, 2020
@talldan talldan added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed
Projects
None yet
Development

No branches or pull requests

3 participants