MCPcopy Index your code
hub / github.com/darkreader/darkreader / getModifiedSelectionStyle

Function getModifiedSelectionStyle

src/inject/dynamic-theme/modify-css.ts:210–222  ·  view source on GitHub ↗
(theme: Theme)

Source from the content-addressed store, hash-verified

208}
209
210function getModifiedSelectionStyle(theme: Theme) {
211 const lines: string[] = [];
212 const modifiedSelectionColor = getSelectionColor(theme);
213 const backgroundColorSelection = modifiedSelectionColor.backgroundColorSelection;
214 const foregroundColorSelection = modifiedSelectionColor.foregroundColorSelection;
215 ['::selection', '::-moz-selection'].forEach((selection) => {
216 lines.push(`${selection} {`);
217 lines.push(` background-color: ${backgroundColorSelection} !important;`);
218 lines.push(` color: ${foregroundColorSelection} !important;`);
219 lines.push('}');
220 });
221 return lines.join('\n');
222}
223
224function getModifiedScrollbarStyle(theme: Theme) {
225 let colorTrack: string;

Callers 1

Calls 1

getSelectionColorFunction · 0.85

Tested by

no test coverage detected