mirror of
https://github.com/wassname/template.git
synced 2026-07-06 02:48:42 +08:00
Fixing shadow dom d-math weirdness
This commit is contained in:
@@ -8,7 +8,24 @@ import { renderMathInElement } from '../helpers/katex-auto-render';
|
||||
export const katexJSURL = 'https://distill.pub/third-party/katex/katex.min.js';
|
||||
export const katexCSSTag = '<link rel="stylesheet" href="https://distill.pub/third-party/katex/katex.min.css" crossorigin="anonymous">';
|
||||
|
||||
export const style = `
|
||||
.katex-display {
|
||||
text-align: left;
|
||||
padding: 8px 0 8px 0;
|
||||
margin: 20px 0 20px 24px;
|
||||
}
|
||||
|
||||
.katex {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
font-size: 1.18em;
|
||||
}
|
||||
`;
|
||||
|
||||
const T = Template('d-math', `
|
||||
|
||||
${katexCSSTag}
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
@@ -20,9 +37,9 @@ const T = Template('d-math', `
|
||||
display: block;
|
||||
}
|
||||
|
||||
</style>
|
||||
${style}
|
||||
|
||||
${katexCSSTag}
|
||||
</style>
|
||||
|
||||
<span id="katex-container"></span>
|
||||
`);
|
||||
|
||||
@@ -188,18 +188,6 @@ d-figure {
|
||||
|
||||
/* KaTeX */
|
||||
|
||||
d-article .katex-display {
|
||||
text-align: left;
|
||||
padding: 8px 0 8px 0;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
d-article .katex {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
font-size: 1.18em;
|
||||
}
|
||||
|
||||
.katex, .katex-prerendered {
|
||||
contain: content;
|
||||
display: inline-block;
|
||||
|
||||
@@ -3,8 +3,9 @@ import layout from './styles-layout.css';
|
||||
import article from './styles-article.css';
|
||||
import print from './styles-print.css';
|
||||
import { style as byline } from '../components/d-byline.js';
|
||||
import { style as math } from '../components/d-math.js';
|
||||
|
||||
export const styles = base + layout + byline + article + print;
|
||||
export const styles = base + layout + byline + math + article + print;
|
||||
|
||||
export function makeStyleTag(dom) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user