import {Plugin} from 'siyuan';
export class Style {
constructor(p: Plugin) {
this.icons.forEach(icon =>
p.addIcons(icon)
)
this.applyStyle()
}
private icons = [
// info - https://fonts.google.com/icons?selected=Material+Symbols+Outlined:info
`
`,
// spell check - https://fonts.google.com/icons?selected=Material+Symbols+Outlined:spellcheck
`
`,
// language - https://fonts.google.com/icons?selected=Material+Symbols+Outlined:language_chinese_quick
`
`,
// toggle - https://fonts.google.com/icons?selected=Material+Symbols+Outlined:toggle_on
`
`,
// autodetect - https://fonts.google.com/icons?selected=Material+Symbols+Outlined:network_intelligence
`
`,
// error - https://fonts.google.com/icons?selected=Material+Symbols+Outlined
`
`,
// add - https://fonts.google.com/icons?selected=Material+Symbols+Outlined:add
`
`
]
private applyStyle() {
const style = document.createElement('style');
style.innerHTML = `
.underline-overlay {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
z-index: 2;
}
.error-underline {
position: absolute;
height: 2px;
background-image:
radial-gradient(circle at 2px 1px, #ff4444 1px, transparent 1px),
radial-gradient(circle at 6px 1px, #ff4444 1px, transparent 1px);
background-size: 8px 2px;
background-repeat: repeat-x;
background-position: 0 bottom;
}`
window.document.head.appendChild(style);
}
}