aboutsummaryrefslogtreecommitdiff
path: root/anki-card-template/card.css
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-01-28 10:22:25 +0100
committerlonkaars <loek@pipeframe.xyz>2023-01-28 10:22:25 +0100
commitc351f01b12a13c149e3946e2393071903dc245ce (patch)
treeae293ac89420e1d28396f729084a9993047e5cbe /anki-card-template/card.css
parent7f752ac3f2165e08ed2041a13488db3a8740722c (diff)
fix onorientationchange handler + opacity for non-highlighted text in sentence instead of hardcoded hex values2.2.2
Diffstat (limited to 'anki-card-template/card.css')
-rw-r--r--anki-card-template/card.css8
1 files changed, 3 insertions, 5 deletions
diff --git a/anki-card-template/card.css b/anki-card-template/card.css
index c8ffd6f..885b0a7 100644
--- a/anki-card-template/card.css
+++ b/anki-card-template/card.css
@@ -19,6 +19,7 @@
--definition-marker-height: 2px; /* definition marker height (mobile vertical only) */
--definition-marker-opacity: 50%; /* definition marker opacity (mobile vertical only) */
--indicator-stroke-weight: 1px; /* pitch accent / word type indicator stroke weight */
+ --sentence-highlight-contrast: 80%; /* opacity of non-highlighted text in sentence */
}
.mobile #card {
--text-block-padding: 0.5em;
@@ -34,10 +35,8 @@ body {
}
/* increase contrast of highlighted word */
-#card #sentence:has(b) { color: #000b; }
-#card #sentence b { color: #000f; }
-.night_mode #card #sentence:has(b) { color: #fffb; }
-.night_mode #card #sentence b { color: #ffff; }
+#card #sentence:has(b) > * { opacity: var(--sentence-highlight-contrast); }
+#card #sentence > b { opacity: 100%; }
/* body margin */
body {
@@ -356,7 +355,6 @@ body {
opacity: 70%;
}
-
/* theme colors */
#target-word-reading .indicator,
.indicator .stamp { color: white; }