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

Classname overwritte with Craft cms #303

Closed
stephanedemotte opened this issue Oct 11, 2024 · 1 comment
Closed

Classname overwritte with Craft cms #303

stephanedemotte opened this issue Oct 11, 2024 · 1 comment
Labels

Comments

@stephanedemotte
Copy link

Description

Hello, if i use the same classname of one of Craft CMS classname, the style is apply.
If i declare a classname used by Craft, Craft element is overwritted.

Steps to reproduce

Image

Will change all the Craft cms button style

Image


Image

Will change the btn style in my Cke Editor

Image

Additional info

  • Craft version: 5.4.7.1
  • Plugins & versions: 4.2.0
@i-just
Copy link
Contributor

i-just commented Oct 14, 2024

Hi, thanks for getting in touch!

The styles you define in the CKEditor Config Custom Styles field are added to the head of the page (and apply to the whole page). If you use a class name that’s used in other places, those styles will affect elements outside of the CKEditor, too. If that's not a desired behaviour in your case, you can either use a unique class name (e.g. mycke-btn), or ensure your styles only target that class name when it’s inside a CKEditor field (e.g. .ck-editor__main .btn).

I hope this helps!

I’ll close this now, but feel free to reach out again if you run into any further problems.

@i-just i-just closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants