Add custom properties to atom-workspace to track editor properties (#16731)

* Add custom properties to atom-workspace

These track the editor's current font size, font family, and line
height.

* Move editor styles to text-editor; add monospace fallback

* Add default font family

So that there will always be a valid value.

* Fix specs
This commit is contained in:
Will Binns-Smith
2018-02-21 19:02:14 -08:00
committed by GitHub
parent e9d4163899
commit b42972fa84
3 changed files with 13 additions and 6 deletions

View File

@@ -56,10 +56,10 @@ class WorkspaceElement extends HTMLElement {
}
updateGlobalTextEditorStyleSheet () {
const styleSheetSource = `atom-text-editor {
font-size: ${this.config.get('editor.fontSize')}px;
font-family: ${this.config.get('editor.fontFamily')};
line-height: ${this.config.get('editor.lineHeight')};
const styleSheetSource = `atom-workspace {
--editor-font-size: ${this.config.get('editor.fontSize')}px;
--editor-font-family: ${this.config.get('editor.fontFamily')};
--editor-line-height: ${this.config.get('editor.lineHeight')};
}`
this.styleManager.addStyleSheet(styleSheetSource, {sourcePath: 'global-text-editor-styles', priority: -1})
}