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

selectionBackground has no effect #5

Open
LaKing opened this issue Jan 10, 2023 · 2 comments
Open

selectionBackground has no effect #5

LaKing opened this issue Jan 10, 2023 · 2 comments

Comments

@LaKing
Copy link

LaKing commented Jan 10, 2023

Hi, ..

I'm using the cobalt theme from thememirror. The only problem I face with this theme, is that the selected text highlighting needs more contrast, it is hard to see the selected area.

I've tried a few approaches, but couldn't make it.
It seems like selectionBackground has no effect.
Pure css seems to be overridden, at least for the background.

What is the recommended method for setting the highlighted text?

@LaKing
Copy link
Author

LaKing commented Jan 10, 2023

For googlers finding this, the workaround is

let highlightTheme = EditorView.theme({
  "&.cm-focused .cm-selectionBackground, ::selection": {
    backgroundColor: "#D00"
  },
}, {dark: true});
    
extensions.push(highlightTheme);

@JinXJinX
Copy link

There is a typo in the create-theme.ts.
This PR fixed that #7

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

No branches or pull requests

2 participants