Stylesheet CSS issue in editor with "body" in variable name

Cwicly Plugin version: 1.2.9.2.1

Hi,

It seems there’s a bad string substitution in my variable names coming from Cwicly stylesheets:

image

image

“body” has been replaced by “.editor-styles-wrapper” :wink:

This subsitution should only apply to “body” strings contained in selectors, and only when it is the real body (for instance, not “.something-body”).

I think that’s something Gutenberg does out of the box. The editor-styles stuff is not directly related to cwicly, unfortunately it comes from the block editor itself! :frowning:

Cheers

1 Like

That’s what I thought too, but I found a code to inject my CSS with wp hooks, and only the selector is altered, not the variable name:

I’m not sure, though, that the script I found is 100% respectful of CSS injection in editor, since it is kind of a hack, even if it appears to use hooks properly.

Source: Dynamic editor styles and inline CSS without targetting `.editor-styles-wrapper` · Issue #18571 · WordPress/gutenberg · GitHub

Hi @yankiara,

Thank you very much for the report.
This is indeed a substitution that is done by Cwicly on the backend to make sure that default Gutenberg styles don’t override styles you might apply with a global stylesheet.

I can confirm there is an issue with the current implementation. We should have a fix in the next update.

Thanks for taking the time with the screenshots, much appreciated.

Cheers,

1 Like

Awesome!!! Do you sleep sometimes?
I’ve never met such a reactive developper :pray:

By the way, after a few hours of testing, I must admit Cwicly is HUGE.
Coming from other builders, there are so many details that make it better, this is some serious job!
And so less bugs :rofl:
Congratulations to the whole team :heart:

So, regarding the CSS issue, there is also some weird duplicate selectors:

3 Likes

Thanks for that @yankiara, means a lot!!

I’ve been meaning to revisit these as the function does date back a bit…
Thanks for pointing it out :slight_smile:

After working a fews minutes on a SCSS stylesheet, my browser (Brave) tab freezes, then crashes.

Hi @yankiara,

Thanks again for the report on this one.
This should now be fixed in 1.2.9.2.3 with a reworked rule parser which should also fix the duplicate selectors.

If you still encounter an issue with this, I’d be grateful if you could let me know.

Cheers,