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

Add simple controls for top/bottom margins, and border-radius #191

Open
KevinBatdorf opened this issue May 7, 2023 · 3 comments
Open

Add simple controls for top/bottom margins, and border-radius #191

KevinBatdorf opened this issue May 7, 2023 · 3 comments

Comments

@KevinBatdorf
Copy link
Owner

This is really more of a theme or WP core thing, I think, but while WP is catching up I can add a few common styling tools tot he editor.

@adriancs2
Copy link

adriancs2 commented May 28, 2023

Here's an alternative solution:

I am able to edit the top/bottom margin and border-radius by inserting additional CSS with the help of a plugin call Simple Custom CSS and JS

insert the following CSS to the frontend:

.wp-block-kevinbatdorf-code-block-pro {
    margin-top: 25px; /* Top Margin */
    margin-bottom: 25px; /* Bottom Margin */
}

.wp-block-kevinbatdorf-code-block-pro:not(.code-block-pro-editor) pre {
    /* Border Radius of the code block */
    border-radius: 10px !important;
}

code-block-border-radius

@KevinBatdorf
Copy link
Owner Author

Yeah that will work for some people, but asking users to install a plugin and add CSS isn't really a good overall solution. Thanks for sharing though.

Is there a reason you used the plugin rather than just add CSS to your theme?

@adriancs2
Copy link

adriancs2 commented May 29, 2023

at the customize theme section [menu] > [appearance] > [customized]
The "Additional CSS" section allows adding custom css. The added CSS will remain as long as the same theme is using. Once the site change to a new theme, the added CSS will be reset. Though the CSS can be copied before theme changed.

Some theme doesn't have the section for "Additional CSS", for example:

I once tried edit code at "theme file editor", [menu] > [appearance] > [theme file editor]
once the theme files updated, the modification of code will be reset.

the plugin allows css for code block works outside the theme. it has less dependant and interference by the theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants