mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
Fix anki-editable styles not applying
This commit is contained in:
parent
0a3710e967
commit
8a9baca554
8 changed files with 56 additions and 57 deletions
|
@ -148,8 +148,7 @@ fn build_css(build: &mut Build) -> Result<()> {
|
|||
},
|
||||
)?;
|
||||
}
|
||||
let other_ts_css =
|
||||
build.inputs_with_suffix(inputs![":ts:editable", ":ts:reviewer:reviewer.css"], ".css");
|
||||
let other_ts_css = build.inputs_with_suffix(inputs![":ts:reviewer:reviewer.css"], ".css");
|
||||
build.add_action(
|
||||
"qt:aqt:data:web:css",
|
||||
CopyFiles {
|
||||
|
|
|
@ -202,19 +202,6 @@ fn build_and_check_pages(build: &mut Build) -> Result<()> {
|
|||
|
||||
Ok(())
|
||||
};
|
||||
// we use the generated .css file separately
|
||||
build_page(
|
||||
"editable",
|
||||
false,
|
||||
inputs![
|
||||
":ts:lib",
|
||||
":ts:components",
|
||||
":ts:domlib",
|
||||
":ts:sveltelib",
|
||||
":sass",
|
||||
":sveltekit",
|
||||
],
|
||||
)?;
|
||||
build_page(
|
||||
"congrats",
|
||||
true,
|
||||
|
|
|
@ -57,21 +57,5 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
></anki-editable>
|
||||
|
||||
<style lang="scss">
|
||||
anki-editable {
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
overflow: auto;
|
||||
overflow-wrap: anywhere;
|
||||
/* fallback for iOS */
|
||||
word-break: break-word;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
min-height: 1.5em;
|
||||
}
|
||||
|
||||
/* editable-base.scss contains styling targeting user HTML */
|
||||
@import "./content-editable.scss";
|
||||
</style>
|
||||
|
|
|
@ -127,24 +127,5 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
/>
|
||||
|
||||
<style lang="scss">
|
||||
:global(anki-mathjax) {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: var(--vertical-center);
|
||||
}
|
||||
|
||||
.block {
|
||||
display: block;
|
||||
margin: 1rem auto;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.empty {
|
||||
vertical-align: text-bottom;
|
||||
|
||||
width: var(--font-size);
|
||||
height: var(--font-size);
|
||||
}
|
||||
@import "./mathjax.scss";
|
||||
</style>
|
||||
|
|
15
ts/lib/editable/content-editable.scss
Normal file
15
ts/lib/editable/content-editable.scss
Normal file
|
@ -0,0 +1,15 @@
|
|||
anki-editable {
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
overflow: auto;
|
||||
overflow-wrap: anywhere;
|
||||
/* fallback for iOS */
|
||||
word-break: break-word;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
min-height: 1.5em;
|
||||
}
|
|
@ -2,6 +2,5 @@
|
|||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
import "./editable-base.scss";
|
||||
/* only imported for the CSS */
|
||||
import "./ContentEditable.svelte";
|
||||
import "./Mathjax.svelte";
|
||||
import "./content-editable.scss";
|
||||
import "./mathjax.scss";
|
||||
|
|
20
ts/lib/editable/mathjax.scss
Normal file
20
ts/lib/editable/mathjax.scss
Normal file
|
@ -0,0 +1,20 @@
|
|||
:global(anki-mathjax) {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: var(--vertical-center);
|
||||
}
|
||||
|
||||
.block {
|
||||
display: block;
|
||||
margin: 1rem auto;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.empty {
|
||||
vertical-align: text-bottom;
|
||||
|
||||
width: var(--font-size);
|
||||
height: var(--font-size);
|
||||
}
|
|
@ -7,6 +7,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
import type { StyleLinkType, StyleObject } from "./CustomStyles.svelte";
|
||||
import CustomStyles from "./CustomStyles.svelte";
|
||||
import editableBaseCSS from "$lib/editable/editable-base.scss?url";
|
||||
import contentEditableCSS from "$lib/editable/content-editable.scss?url";
|
||||
import mathjaxCSS from "$lib/editable/mathjax.scss?url";
|
||||
|
||||
import { mount } from "svelte";
|
||||
|
||||
export let callback: (styles: Record<string, any>) => void;
|
||||
|
@ -45,9 +49,19 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
const styles: StyleLinkType[] = [
|
||||
{
|
||||
id: "rootStyle",
|
||||
id: "editableBaseStyle",
|
||||
type: "link",
|
||||
href: "./_anki/css/editable.css",
|
||||
href: editableBaseCSS,
|
||||
},
|
||||
{
|
||||
id: "contentEditableStyle",
|
||||
type: "link",
|
||||
href: contentEditableCSS,
|
||||
},
|
||||
{
|
||||
id: "mathjaxStyle",
|
||||
type: "link",
|
||||
href: mathjaxCSS,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue