提交 89d594a4 编写于 作者: A Alex Dima

Small css tweaks

上级 badd8d18
......@@ -114,6 +114,7 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp
// These two dom nodes must be constructed up front, since references are needed in the layout provider (scrolling & co.)
this.linesContent = document.createElement('div');
this.linesContent.className = editorBrowser.ClassNames.LINES_CONTENT + ' monaco-editor-background';
this.linesContent.style.position = 'absolute';
this.domNode = document.createElement('div');
this.domNode.className = configuration.editor.viewInfo.editorClassName;
......
......@@ -159,17 +159,9 @@ export class ViewOverlayLine implements IVisibleLineData {
}
getLineOuterHTML(out: string[], lineNumber: number, deltaTop: number): void {
out.push('<div lineNumber="');
out.push(lineNumber.toString());
out.push('" style="top:');
out.push(deltaTop.toString());
out.push('px;height:');
out.push(this._lineHeight.toString());
out.push('px;" class="');
out.push(editorBrowser.ClassNames.VIEW_LINE);
out.push('">');
out.push(`<div lineNumber="${lineNumber}" style="position:absolute;top:${deltaTop}px;width:100%;height:${this._lineHeight}px;">`);
out.push(this.getLineInnerHTML(lineNumber));
out.push('</div>');
out.push(`</div>`);
}
getLineInnerHTML(lineNumber: number): string {
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .contentWidgets {
position: absolute;
top: 0;
}
\ No newline at end of file
......@@ -5,7 +5,6 @@
'use strict';
import 'vs/css!./contentWidgets';
import * as dom from 'vs/base/browser/dom';
import { StyleMutator } from 'vs/base/browser/styleMutator';
import * as editorCommon from 'vs/editor/common/editorCommon';
......@@ -68,6 +67,8 @@ export class ViewContentWidgets extends ViewPart {
this.domNode = document.createElement('div');
this.domNode.className = ClassNames.CONTENT_WIDGETS;
this.domNode.style.position = 'absolute';
this.domNode.style.top = '0';
this.overflowingContentWidgetsDomNode = document.createElement('div');
this.overflowingContentWidgetsDomNode.className = ClassNames.OVERFLOWING_CONTENT_WIDGETS;
......
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .current-line {
.monaco-editor .view-overlays .current-line {
display: block;
position: absolute;
left: 0;
......@@ -11,14 +11,14 @@
box-sizing: border-box;
}
.monaco-editor.vs .current-line {
.monaco-editor.vs .view-overlays .current-line {
border: 2px solid #eee;
}
.monaco-editor.vs-dark .current-line {
.monaco-editor.vs-dark .view-overlays .current-line {
border: 2px solid #282828;
}
.monaco-editor.hc-black .current-line {
.monaco-editor.hc-black .view-overlays .current-line {
border: 2px solid #f38518;
}
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .current-line {
.monaco-editor .margin-view-overlays .current-line-margin {
display: block;
position: absolute;
left: 0;
......@@ -11,14 +11,14 @@
box-sizing: border-box;
}
.monaco-editor.vs .current-line {
.monaco-editor.vs .margin-view-overlays .current-line-margin {
border: 2px solid #eee;
}
.monaco-editor.vs-dark .current-line {
.monaco-editor.vs-dark .margin-view-overlays .current-line-margin {
border: 2px solid #282828;
}
.monaco-editor.hc-black .current-line {
.monaco-editor.hc-black .margin-view-overlays .current-line-margin {
border: 2px solid #f38518;
}
......@@ -93,7 +93,7 @@ export class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay {
if (lineNumber === this._primaryCursorLineNumber) {
if (this._shouldShowCurrentLine()) {
return (
'<div class="current-line" style="width:'
'<div class="current-line-margin" style="width:'
+ String(this._contentLeft)
+ 'px; height:'
+ String(this._lineHeight)
......
......@@ -133,17 +133,9 @@ export class ViewLine implements IVisibleLineData {
}
public getLineOuterHTML(out: string[], lineNumber: number, deltaTop: number): void {
out.push('<div lineNumber="');
out.push(lineNumber.toString());
out.push('" style="top:');
out.push(deltaTop.toString());
out.push('px;height:');
out.push(this._lineHeight.toString());
out.push('px;" class="');
out.push(ClassNames.VIEW_LINE);
out.push('">');
out.push(`<div lineNumber="${lineNumber}" style="top:${deltaTop}px;height:${this._lineHeight}px;" class="${ClassNames.VIEW_LINE}">`);
out.push(this.getLineInnerHTML(lineNumber));
out.push('</div>');
out.push(`</div>`);
}
public getLineInnerHTML(lineNumber: number): string {
......
......@@ -47,11 +47,6 @@
width: 100%;
}
.monaco-editor .lines-content {
position: absolute;
top: 0;
}
/* TODO@tokenization bootstrap fix */
/*.monaco-editor .view-line > span > span {
float: none;
......
......@@ -278,7 +278,8 @@ class EditorReferenceSearchStyleRules extends EditorStyleRules {
class EditorLineHighlightStyleRules extends EditorStyleRules {
public getCssRules(theme: Theme, cssRules: string[]): void {
if (theme.getGlobalSettings().lineHighlight) {
cssRules.push(`.monaco-editor.${theme.getSelector()} .current-line { background-color: ${new Color(theme.getGlobalSettings().lineHighlight)}; border: none; }`);
cssRules.push(`.monaco-editor.${theme.getSelector()} .view-overlays .current-line { background-color: ${new Color(theme.getGlobalSettings().lineHighlight)}; border: none; }`);
cssRules.push(`.monaco-editor.${theme.getSelector()} .margin-view-overlays .current-line-margin { background-color: ${new Color(theme.getGlobalSettings().lineHighlight)}; border: none; }`);
}
this.addBackgroundColorRule(theme, '.rangeHighlight', theme.getGlobalSettings().rangeHighlight, cssRules);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册