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

fix(NcRichContenteditable): adjust styles and use CSS Modules to avoid global styles leak #5235

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Feb 9, 2024

☑️ Resolves

NcRichContenteditable has global CSS styles to style Tribute autocomplete. It works fine, until there are more than one version of those styles on the page. Styles should be scoped.

@szaimen @hamza221 @JuliaKirschenheuter Could you please check it in your apps? The bug was not reproducible for me...

Screenshots

Note, there is no data-v-<hash> attrs in both cases.

Before After
image image

🚧 Tasks

  • Use CSS Modules for scoping styles of Tribute autocomplete (scoped doesn't work for non-component styles and doesn't truly scope from styles outside, having only one-way scoping)
  • Adjust styles, remove some unneeded classes and fix typos in CSS
    • Some issues were not noticeable before, because of other global styles
  • Add CSS Modules support for Styleguidist

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

@ShGKme ShGKme added bug Something isn't working regression Regression of a previous working feature feature: rich-contenteditable Related to the rich-contenteditable components labels Feb 9, 2024
@ShGKme ShGKme added this to the 8.6.3 milestone Feb 9, 2024
@ShGKme ShGKme self-assigned this Feb 9, 2024
@ShGKme
Copy link
Contributor Author

ShGKme commented Feb 9, 2024

/backport to next

Copy link
Contributor

@JuliaKirschenheuter JuliaKirschenheuter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine now! Thanks a lot!

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and much cleaner!
(Funny how complex the webpack config is vs. no changes in the vite config^^)

@JuliaKirschenheuter JuliaKirschenheuter merged commit 4287b5c into master Feb 9, 2024
18 checks passed
@JuliaKirschenheuter JuliaKirschenheuter deleted the fix/nc-rich-contenteditable--scope-autocomplete-styles-with-css-modules branch February 9, 2024 17:42
@ShGKme
Copy link
Contributor Author

ShGKme commented Feb 9, 2024

(Funny how complex the webpack config is vs. no changes in the vite config^^)

Vite has pre-config for Rollup for "typical" bundling, but then you need to write your own plugin if you have something more special 😝

@susnux susnux modified the milestones: 8.6.3, 8.7.0 Feb 18, 2024
@skjnldsv skjnldsv mentioned this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature: rich-contenteditable Related to the rich-contenteditable components regression Regression of a previous working feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken styling in slash command smart picker seems to be broken
3 participants