mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-28 09:10:17 +02:00
Move code fontsize to CSS custom variable.
Console fontsize is also now controlled by settings.
This commit is contained in:
@@ -286,11 +286,10 @@ export default class ContentWrap extends Component {
|
||||
]).then(() => this.setPreviewContent(true));
|
||||
}
|
||||
applyCodemirrorSettings(prefs) {
|
||||
/* if (window.consoleEl) {
|
||||
window.consoleEl.querySelector(
|
||||
'.CodeMirror'
|
||||
).style.fontSize = `${parseInt(prefs.fontSize, 10)}px`;
|
||||
} */
|
||||
document.documentElement.style.setProperty(
|
||||
'--code-font-size',
|
||||
`${parseInt(prefs.fontSize, 10)}px`
|
||||
);
|
||||
|
||||
// Replace correct css file in LINK tags's href
|
||||
if (prefs.editorTheme) {
|
||||
|
@@ -294,11 +294,10 @@ export default class ContentWrapFiles extends Component {
|
||||
);
|
||||
}
|
||||
applyCodemirrorSettings(prefs) {
|
||||
if (window.consoleEl) {
|
||||
// window.consoleEl.querySelector(
|
||||
// '.CodeMirror'
|
||||
// ).style.fontSize = `${parseInt(prefs.fontSize, 10)}px`;
|
||||
}
|
||||
document.documentElement.style.setProperty(
|
||||
'--code-font-size',
|
||||
`${parseInt(prefs.fontSize, 10)}px`
|
||||
);
|
||||
|
||||
// Replace correct css file in LINK tags's href
|
||||
if (prefs.editorTheme) {
|
||||
|
@@ -38,9 +38,6 @@ emmet(CodeMirror);
|
||||
export default class UserCodeMirror extends Component {
|
||||
componentDidMount() {
|
||||
this.initEditor();
|
||||
this.textarea.parentNode.querySelector(
|
||||
'.CodeMirror'
|
||||
).style.fontSize = `${parseInt(this.props.prefs.fontSize, 10)}px`;
|
||||
}
|
||||
shouldComponentUpdate(nextProps) {
|
||||
if (nextProps.prefs !== this.props.prefs) {
|
||||
@@ -60,12 +57,6 @@ export default class UserCodeMirror extends Component {
|
||||
this.cm.setOption('keyMap', prefs.keymap);
|
||||
this.cm.setOption('lineWrapping', prefs.lineWrap);
|
||||
|
||||
if (this.textarea) {
|
||||
this.textarea.parentNode.querySelector(
|
||||
'.CodeMirror'
|
||||
).style.fontSize = `${parseInt(prefs.fontSize, 10)}px`;
|
||||
}
|
||||
|
||||
this.cm.refresh();
|
||||
}
|
||||
|
||||
|
@@ -1445,7 +1445,7 @@ body > #demo-frame {
|
||||
flex-basis: 0;
|
||||
}
|
||||
.console__items li {
|
||||
font-size: 1em !important;
|
||||
font-size: var(--code-font-size) !important;
|
||||
line-height: inherit !important;
|
||||
padding: 5px 10px !important;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
||||
|
Reference in New Issue
Block a user