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