Add version history, screenshots, embed generator, collections, npm search, format-on-save, and custom fonts
This commit is contained in:
@@ -204,9 +204,16 @@ function renderTabBar(tabs) {
|
||||
|
||||
tabs.forEach((tab) => {
|
||||
const btn = document.createElement('button');
|
||||
btn.className = 'tab-btn';
|
||||
btn.className = `tab-btn tab-lang-${tab.lang}`;
|
||||
btn.dataset.tab = tab.id;
|
||||
btn.textContent = tab.label;
|
||||
|
||||
const dot = document.createElement('span');
|
||||
dot.className = 'tab-color-dot';
|
||||
btn.appendChild(dot);
|
||||
|
||||
const label = document.createElement('span');
|
||||
label.textContent = tab.label;
|
||||
btn.appendChild(label);
|
||||
|
||||
// Add CSS type selector inside the CSS tab
|
||||
if (tab.id === 'css') {
|
||||
@@ -360,3 +367,13 @@ export function setEditorTheme(themeId) {
|
||||
editorOpts.theme = themeId;
|
||||
monaco.editor.setTheme(themeId);
|
||||
}
|
||||
|
||||
export function setEditorFont(fontFamily) {
|
||||
const family = fontFamily === 'default' ? "'Cascadia Code', 'Fira Code', monospace" : `'${fontFamily}', monospace`;
|
||||
editorOpts.fontFamily = family;
|
||||
const tabs = MODE_TABS[currentMode];
|
||||
if (!tabs) return;
|
||||
tabs.forEach((tab) => {
|
||||
if (editors[tab.id]) editors[tab.id].updateOptions({ fontFamily: family });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user