Skip to content

Commit

Permalink
Use CSS variables over registerThemingParticipant - rulers viewparts (#…
Browse files Browse the repository at this point in the history
…165466)

* edits

* edits
  • Loading branch information
bsacm committed Nov 11, 2022
1 parent 1e10847 commit b982536
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/vs/editor/browser/viewParts/rulers/rulers.css
Expand Up @@ -6,4 +6,5 @@
.monaco-editor .view-ruler {
position: absolute;
top: 0;
}
box-shadow: 1px 0 0 0 var(--vscode-editorRuler-ruler) inset;
}
9 changes: 0 additions & 9 deletions src/vs/editor/browser/viewParts/rulers/rulers.ts
Expand Up @@ -6,11 +6,9 @@
import 'vs/css!./rulers';
import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';
import { ViewPart } from 'vs/editor/browser/view/viewPart';
import { editorRuler } from 'vs/editor/common/core/editorColorRegistry';
import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/browser/view/renderingContext';
import { ViewContext } from 'vs/editor/common/viewModel/viewContext';
import * as viewEvents from 'vs/editor/common/viewEvents';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { EditorOption, IRulerOption } from 'vs/editor/common/config/editorOptions';

export class Rulers extends ViewPart {
Expand Down Expand Up @@ -100,10 +98,3 @@ export class Rulers extends ViewPart {
}
}
}

registerThemingParticipant((theme, collector) => {
const rulerColor = theme.getColor(editorRuler);
if (rulerColor) {
collector.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${rulerColor} inset; }`);
}
});

0 comments on commit b982536

Please sign in to comment.