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 Request: Global styles #333

Open
senadir opened this issue Jul 27, 2024 · 1 comment
Open

Feature Request: Global styles #333

senadir opened this issue Jul 27, 2024 · 1 comment

Comments

@senadir
Copy link

senadir commented Jul 27, 2024

I recently wrote a tutorial with 16 code blocks, and I wanted to apply a style change that needed to get applied to all 16 of them, I'm wondering if there's an ability to move some settings to be global styles so that they can be changed from site editor tab directly, and can be overriden locally if needed.

@KevinBatdorf
Copy link
Owner

Right now it's not possible, but the next major version of the plugin will have something built in for this. For example, you'd be able to select both a light and dark theme, it would generate the colors, and set them via css variables. I'd then be able to add a global UI that would let the user override everything, or narrow it down somehow (maybe override only based on language, or theme). I'm thinking about adding "profiles" too so you could override specific global profiles, and leave others alone.

I just need to find time to work on upgrading the plugin as it's going to be a lot of work with a lot of breaking changes (also need to update the underlining engine that parses it), and WordPress doens't handle library deprecations like this (I might have to ship both versions in the same plugin - or override the block error notification).

I'll start focusing on it this coming month though.

For now, you could probably hack it with css specificity by selecting the colors you want to change and overriding them. I know it's not ideal though.

[class*='code-block-pro'] span[style*="#E3541C"] {
    color: lawngreen !important;
}

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