font-change-script
code:script.js
// valueにfont-familyに設定したい値を入れる。
const changeFont = (value) => {
let styleEl = document.getElementById('changeFont-style');
if (styleEl === null) {
styleEl = document.createElement('style');
const dc = document.getElementById('dedicated-container');
styleEl.id = 'changeFont-style';
dc.appendChild(styleEl);
}
styleEl.textContent = .editor, .grid li, .list li.page-list-item, .stream {font-family: ${value} !important};
}
scrapbox.PageMenu.addMenu({
title: 'Change Font',
onClick: () => {},
});
scrapbox.PageMenu('Change Font').addItem({
title: 'Sans serif',
onClick: () => {changeFont('"Inter", "Roboto", "源ノ角ゴシック JP", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif')},
});
scrapbox.PageMenu('Change Font').addItem({
title: 'Serif',
onClick: () => {changeFont('"源ノ明朝 JP", "Noto Serif JP", serif')},
});