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

Dark Theme support for RichText #669

Closed
nbelyh opened this issue Sep 17, 2020 · 7 comments
Closed

Dark Theme support for RichText #669

nbelyh opened this issue Sep 17, 2020 · 7 comments
Assignees
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:enhancement New feature or enhancement of existing capability

Comments

@nbelyh
Copy link
Contributor

nbelyh commented Sep 17, 2020

Category

[x] Enhancement

[ ] Bug

[x] Question

Version

Please specify what version of the library you are using: [ 1.20 ]

Expected / Desired Behavior / Question

If you select "Dark" theme type and use rich text edit, the defaults make text unreadable. Basically, if you just enter the text (using the "standard" theme) and then switch the theme to "Dark", the content becomes like this. The text is almost invisible.

image

It would be really nice if the RichText defaults respected the default theme colors. As it's a wrapper around quill, so the defaults on the top DIV (ql-editor) needs to be changed to respect the basic theme color/background.

@ghost
Copy link

ghost commented Sep 17, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Sep 17, 2020
@nbelyh
Copy link
Contributor Author

nbelyh commented Sep 17, 2020

More information: looks like the RichText it just applies ql-snow Quill theme and completely ignores whatever is selected in SharePoint (i.e. it is not theme-aware). A minimalistic workaround could be:

.richtextWrap {
  position: "relative"; /* fix the toolbar position */
  :global(.ql-editor) { /* fix the default theme color */
    blockquote, div, h2, h3, h4, ol, p, ul {
      color: "[theme:black, default:black]";
    }
  }
}
<div className={styles.richtextWrap} >
  <RichText ... />
</div>

@AJIXuMuK
Copy link
Collaborator

Hi @nbelyh,
There are plans to improve controls to support themes and section backgrounds.
We'll work on that closer to IE11 retirement date.

@AJIXuMuK AJIXuMuK added type:enhancement New feature or enhancement of existing capability and removed Needs: Triage 🔍 labels Mar 19, 2021
@dunlapm
Copy link

dunlapm commented Dec 7, 2021

Hi @nbelyh, There are plans to improve controls to support themes and section backgrounds. We'll work on that closer to IE11 retirement date.

Is there any kind of timeline for this? This bug makes the control nearly unusable on sites with dark backgrounds, and also affects the side panel text.

@nbelyh
Copy link
Contributor Author

nbelyh commented Dec 7, 2021

@dunlapm I have fixed that for my project (look at the above scss fragment for example), but this whole thing (proper theme support for spfx controls library, especially this control) will IMHO require much more effort. I have tried that, but as far as I remember, "we need to go deeper" and the problem lies actually down in the SPFx build tools, that are not configured to support styles properly (the @microsoft/load-themed-styles package). So the theming that comes from FluentUI works, but direct definitions using themes don't. But I may be mistaking or forgetting something, it was about 1.5 years ago.

@nbelyh
Copy link
Contributor Author

nbelyh commented Feb 22, 2023

Created PR to fix the issue

@joaojmendes joaojmendes self-assigned this Feb 24, 2023
@joaojmendes joaojmendes added the status:fixed-next-drop Issue will be fixed in upcoming release. label Feb 24, 2023
@joelfmrodrigues
Copy link
Collaborator

New release just published, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:enhancement New feature or enhancement of existing capability
Projects
None yet
Development

No branches or pull requests

5 participants