Skip to content

Commit

Permalink
Merge pull request #181 from 10play/fix-highlight-on-darkmode
Browse files Browse the repository at this point in the history
fix: override highlight selection background on darkmode
  • Loading branch information
GuySerfaty authored Aug 9, 2024
2 parents ab945fc + bd2c1fd commit cd490e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/RichText/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ export const darkEditorCss = `
border-left: 3px solid #babaca;
padding-left: 1rem;
}
.highlight-background {
background-color: #474749;
}
`;
2 changes: 1 addition & 1 deletion src/bridges/HighlightSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const blueBackgroundPlugin = Extension.create({
const { from, to } = tr.selection;
decorations.push(
Decoration.inline(from, to, {
style: 'background-color: #e6e6ff;',
class: 'highlight-background',
})
);
return DecorationSet.create(newEditorState.doc, decorations);
Expand Down
3 changes: 3 additions & 0 deletions src/simpleWebEditor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
.ProseMirror:focus {
outline: none;
}
.highlight-background {
background-color: #e6e6ff;
}
</style>
<body>
<div id="root"></div>
Expand Down

0 comments on commit cd490e5

Please sign in to comment.