akkoma stricter csp compat

This commit is contained in:
Henry Jameson 2025-06-28 14:54:59 +03:00
commit 40a17862a5
5 changed files with 130 additions and 133 deletions

View file

@ -2,6 +2,8 @@
/* stylelint-disable no-descending-specificity */
@use "panel";
@import '@fortawesome/fontawesome-svg-core/styles.css';
:root {
--status-margin: 0.75em;
--post-line-height: 1.4;
@ -30,6 +32,7 @@ body {
font-family: sans-serif;
font-family: var(--font);
margin: 0;
padding: 0;
color: var(--text);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

View file

@ -234,20 +234,14 @@ export const applyConfig = (input) => {
return
}
const head = document.head
const rules = Object
.entries(config)
.filter(([, v]) => v)
.map(([k, v]) => `--${k}: ${v}`).join(';')
document.getElementById('style-config')?.remove()
const styleEl = document.getElementById('theme-holder')
styleEl.id = 'style-config'
head.appendChild(styleEl)
const styleSheet = styleEl.sheet
styleSheet.toString()
styleSheet.insertRule(`:root { ${rules} }`, 'index-max')
// TODO find a way to make this not apply to theme previews