Skip to content

feat(CodeEditor): use custom PatternFly monaco theme #11785

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

logonoff
Copy link
Contributor

@logonoff logonoff commented Apr 25, 2025

What: Closes #11506 #11764

Includes the changes from #11575 but now it overwrites every token from the base vs theme

Note there should be some additional CSS in PatternFly to make this look better (so that the margin around the CodeEditor matches the monaco background color), but I'm not sure of the best way to implement it:

.pf-v6-theme-dark {
  .pf-v6-c-code-editor:not(.pf-m-read-only) {
      --pf-v6-c-code-editor__main--BackgroundColor: var(--pf-t--color--gray--90);
      --pf-v6-c-code-editor__tab--BackgroundColor: var(--pf-t--color--gray--90);
  }
}

I tried looking into using pf-t--global--background--color--primary--default, but it doesn't provide enough contrast in dark mode. Meanwhile, pf-t--global--background--color--secondary--default doesn't provide enough contrast in light mode.

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 25, 2025

@andrew-ronaldson
Copy link
Collaborator

For the Syntax colours I am going to create a design issue to look at some code languages and pick out a colour scheme that will work in light/dark mode. I'm fine with the default palette from Monaco for the time being if it isn't blocking anything critical.

@logonoff
Copy link
Contributor Author

For the Syntax colours I am going to create a design issue to look at some code languages and pick out a colour scheme that will work in light/dark mode. I'm fine with the default palette from Monaco for the time being if it isn't blocking anything critical.

thanks! feel free to edit this branch if the design team makes changes 👍

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

Successfully merging this pull request may close these issues.

Spike: Investigate theming in Monaco editor
3 participants