mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-04 00:41:33 -07:00
fix: preserve jlpt underline color after lookup
This commit is contained in:
@@ -997,6 +997,31 @@ body.settings-modal-open [data-subminer-yomitan-popup-host='true'] {
|
||||
-webkit-text-fill-color: var(--subtitle-frequency-band-5-color, #8aadf4) !important;
|
||||
}
|
||||
|
||||
#subtitleRoot .word.word-jlpt-n1::selection,
|
||||
#subtitleRoot .word.word-jlpt-n1 .c::selection {
|
||||
text-decoration-color: var(--subtitle-jlpt-n1-color, #ed8796) !important;
|
||||
}
|
||||
|
||||
#subtitleRoot .word.word-jlpt-n2::selection,
|
||||
#subtitleRoot .word.word-jlpt-n2 .c::selection {
|
||||
text-decoration-color: var(--subtitle-jlpt-n2-color, #f5a97f) !important;
|
||||
}
|
||||
|
||||
#subtitleRoot .word.word-jlpt-n3::selection,
|
||||
#subtitleRoot .word.word-jlpt-n3 .c::selection {
|
||||
text-decoration-color: var(--subtitle-jlpt-n3-color, #f9e2af) !important;
|
||||
}
|
||||
|
||||
#subtitleRoot .word.word-jlpt-n4::selection,
|
||||
#subtitleRoot .word.word-jlpt-n4 .c::selection {
|
||||
text-decoration-color: var(--subtitle-jlpt-n4-color, #a6e3a1) !important;
|
||||
}
|
||||
|
||||
#subtitleRoot .word.word-jlpt-n5::selection,
|
||||
#subtitleRoot .word.word-jlpt-n5 .c::selection {
|
||||
text-decoration-color: var(--subtitle-jlpt-n5-color, #8aadf4) !important;
|
||||
}
|
||||
|
||||
#subtitleRoot
|
||||
.word:is(.word-jlpt-n1, .word-jlpt-n2, .word-jlpt-n3, .word-jlpt-n4, .word-jlpt-n5):not(
|
||||
.word-known
|
||||
|
||||
@@ -1064,6 +1064,24 @@ test('subtitle annotation CSS underlines JLPT tokens without changing token colo
|
||||
/-webkit-text-fill-color:\s*var\(--subtitle-hover-token-color,\s*#f4dbd6\)\s*!important;/,
|
||||
);
|
||||
|
||||
for (let level = 1; level <= 5; level += 1) {
|
||||
const jlptSelectionLockBlock = extractClassBlock(
|
||||
cssText,
|
||||
`#subtitleRoot .word.word-jlpt-n${level}::selection`,
|
||||
);
|
||||
assert.ok(
|
||||
jlptSelectionLockBlock.length > 0,
|
||||
`word-jlpt-n${level} selection lock should exist`,
|
||||
);
|
||||
assert.match(
|
||||
jlptSelectionLockBlock,
|
||||
new RegExp(
|
||||
`text-decoration-color:\\s*var\\(--subtitle-jlpt-n${level}-color,\\s*#[0-9a-f]{6}\\)\\s*!important;`,
|
||||
'i',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
const selectionBlock = extractClassBlock(cssText, '#subtitleRoot::selection');
|
||||
assert.match(
|
||||
selectionBlock,
|
||||
|
||||
Reference in New Issue
Block a user