wty 0.8.0

Yomitan-compatible dictionaries from wikitionary data
Documentation
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    line-height: 1.6;
    color: #333;
}
/* .entry { */
/*     background: #fff; */
/*     padding: 30px; */
/*     border-radius: 8px; */
/*     box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
/* } */
/* details { */
/*     margin: 10px 0; */
/* } */
/* summary { */
/*     cursor: pointer; */
/*     font-weight: 600; */
/*     color: #0066cc; */
/*     user-select: none; */
/* } */

/* YOMITAN SIDE CSS HERE */

/* Variables */
:root {
    --text-color: #222222;
    --text-color-light1: #555555;
    --text-color-light2: #666666;
    --text-color-light3: #777777;
    --text-color-light4: #888888;
    --background-color: #f8f9fa;
    --background-color-light: #ffffff;
    --background-color-dark1: #eeeeee;
    
    --font-size-no-units: 14;
    --font-size: calc(1px * var(--font-size-no-units));

    --tag-height-no-units: 20;
    --tag-height: calc(1em * var(--tag-height-no-units) / var(--font-size-no-units));
    --tag-font-size-no-units: 11;
    --tag-font-size: calc(1em * var(--tag-font-size-no-units) / var(--font-size-no-units));
    --tag-border-size-no-units: 1;
    --tag-border-size: calc(1em * (var(--tag-border-size-no-units) / var(--font-size-no-units)));
    --tag-border-style: solid;
    --tag-font-weight: bold;
    --tag-border-radius: 0.25em;

    --tag-text-color: #ffffff;
    --tag-border-color: transparent;
    --tag-default-background-color: #8a8a91;
    --tag-name-background-color: #b6327a;
    --tag-expression-background-color: #f0ad4e;
    --tag-popular-background-color: #0275d8;
    --tag-frequent-background-color: #5bc0de;
    --tag-archaism-background-color: #d9534f;
    --tag-dictionary-background-color: #aa66cc;
    --tag-frequency-background-color: #5cb85c;
    --tag-part-of-speech-background-color: #565656;
    --tag-search-background-color: #8a8a91;
    --tag-pronunciation-dictionary-background-color: #6640be;
}

/* This makes the newlines work in examples */
/* FIXME: in pretty mode, it makes the rendering explode */

/* .gloss-content { */
/*     display: block; */
/*     white-space: pre-line; */
/* } */

/* tags */
.tag {
    --tag-color: var(--tag-default-background-color);

    display: inline-flex;
    flex-flow: row nowrap;
    align-items: stretch;
    border: none;
    border-right: none;
    font-size: 1em;
    min-height: var(--tag-height);
    margin: calc(1em / var(--font-size-no-units)) 0.375em calc(1em / var(--font-size-no-units)) 0;
}
.tag-label {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    background-color: var(--tag-color);
    border-radius: var(--tag-border-radius);
    padding: calc(2.5em / var(--font-size-no-units)) 0.375em calc(2.5em / var(--font-size-no-units)) 0.375em;
    color: var(--tag-text-color);
    cursor: pointer;
}
.tag-label-content {
    display: block;
    font-size: var(--tag-font-size);
    font-weight: var(--tag-font-weight);
}
.tag-body {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    position: relative;
    padding: 0 0.375em 0 0.375em;
    border-radius: var(--tag-border-radius);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.tag-body::before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    border-radius: var(--tag-border-radius);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: var(--tag-border-size) var(--tag-border-style) var(--tag-color);
    border-left: none;
    pointer-events: none;
}
.tag-body-content {
    display: block;
    position: relative;
}
.tag:not(.tag-has-body)>.tag-body {
    display: none;
}
.tag.tag-has-body>.tag-label {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.tag[data-category=name] {
    --tag-color: var(--tag-name-background-color);
}
.tag[data-category=expression] {
    --tag-color: var(--tag-expression-background-color);
}
.tag[data-category=popular] {
    --tag-color: var(--tag-popular-background-color);
}
.tag[data-category=frequent] {
    --tag-color: var(--tag-frequent-background-color);
}
.tag[data-category=archaism] {
    --tag-color: var(--tag-archaism-background-color);
}
.tag[data-category=dictionary] {
    --tag-color: var(--tag-dictionary-background-color);
}
.tag[data-category=frequency] {
    --tag-color: var(--tag-frequency-background-color);
}
.tag[data-category=partOfSpeech] {
    --tag-color: var(--tag-part-of-speech-background-color);
}
.tag[data-category=search] {
    --tag-color: var(--tag-search-background-color);
}
.tag[data-category=pronunciation-dictionary] {
    --tag-color: var(--tag-pronunciation-dictionary-background-color);
}

/* YOMITAN CSS HERE */

/* Data-category is locale independent */
.tag[data-category='gender-feminine'] .tag-label{background-color: #ca4d93;}
.tag[data-category='gender-masculine'] .tag-label{background-color: #4d82e8;}
.tag[data-category='gender-neuter'] .tag-label{background-color: #40ac65;}

/* Category colouring is only valid for top-level tags
   https://github.com/yomidevs/yomitan/blob/master/docs/making-yomitan-dictionaries.md
   So we need to add them again for the relevant categories used in inner tags.
*/
div[data-sc-content="tags"] span[data-sc-category="frequent"] {
    background-color: #5bc0de;
}
div[data-sc-content="tags"] span[data-sc-category="archaism"] {
    background-color: #d9534f;
}

div[data-sc-content="tags"] span {
    font-size: 0.8em;
    font-weight: bold;
    padding: 0.2em 0.3em;
    word-break: keep-all;
    border-radius: 0.3em;
    vertical-align: text-bottom;
    background-color: #565656;
    color: white;
    cursor: help;
    margin-right: 0.25em;
}
div[data-sc-content="extra-info"] {
    margin-left: 0.5em;
}
div[data-sc-content="example-sentence"] {
    background-color: color-mix(in srgb, var(--text-color, var(--fg, #333)) 5%, transparent);
    border-color: var(--text-color, var(--fg, #333));
    border-style: none none none solid;
    border-radius: 0.4rem;
    border-width: calc(3em / var(--font-size-no-units, 14));
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.1rem 0.5rem;
}
span[data-sc-content="bold-text"] {
    font-weight: bold;
}
div[data-sc-content="example-sentence-a"] {
    font-size: 1.1em;
    font-style: italic;
}
div[data-sc-content="example-sentence-b"] {
    font-size: 0.8em;
}
div[data-sc-content="example-sentence-c"] {
    font-size: 0.75em;
    text-align: right;
}
details[data-sc-content^="details-entry"] {
    padding-left: 0;
}
summary[data-sc-content="summary-entry"] {
    user-select: none;
    width: max-content;
    padding: 0.1em 0.2em;
}
ol[data-sc-content="glosses"] {
    list-style-type: upper-roman;
}
[data-sc-content="summary-entry"]::marker {
    color: var(--checkbox-disabled-color);
}

/* Circled numbers (note: they contain a space after the number) */
ol[data-sc-content="glosses"] {
    list-style-type: none;
}
ol[data-sc-content="glosses"] > li:nth-child(1) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(2) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(3) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(4) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(5) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(6) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(7) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(8) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(9) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(10) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(11) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(12) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(13) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(14) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(15) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(16) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(17) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(18) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(19) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(20) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(21) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(22) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(23) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(24) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(25) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(26) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(27) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(28) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(29) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(30) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(31) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(32) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(33) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(34) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(35) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(36) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(37) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(38) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(39) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(40) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(41) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(42) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(43) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(44) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(45) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(46) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(47) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(48) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(49) { list-style-type: ""; }
ol[data-sc-content="glosses"] > li:nth-child(50) { list-style-type: ""; }

summary[data-sc-content="summary-entry"] {
    list-style-position: inside;
    color: var(--text-color-light4);
}
details[data-sc-content^="details-entry-Grammar"] summary[data-sc-content="summary-entry"],
details[data-sc-content^="details-entry-Etymology"] summary[data-sc-content="summary-entry"] {
    font-weight: bold;
}

/* Make the label bold, and group synonyms inline, separated by ' • ' */
div[data-sc-content="synonyms"] div[data-sc-content="synonyms-label"] {
    font-weight: bold;
    display: block;
    margin-top: 0.3em;
}
div[data-sc-content="synonyms"] ul[data-sc-content="synonyms-list"] {
    list-style: none;
    padding-left: 1.5em;
}
div[data-sc-content="synonyms"] ul[data-sc-content="synonyms-list"] li {
    display: inline;
}
div[data-sc-content="synonyms"] ul[data-sc-content="synonyms-list"] li:not(:last-child)::after {
    content: "";
}

details[data-sc-content^="details-entry"][open=""] summary[data-sc-content="summary-entry"] {
    color: var(--text-color);
}
details[data-sc-content^="details-entry"][open=""] summary[data-sc-content="summary-entry"]::marker {
    color: var(--text-color);
}
summary[data-sc-content="summary-entry"]:hover {
    border-radius: 0.4em;
    background-color: var(--notification-background-color-lighter);
    cursor: pointer;
    color: var(--text-color);
}
summary[data-sc-content="summary-entry"] ~ div {
    margin: 0.5em 0;
}
div[data-sc-content="backlink"] {
    font-size: 0.7em;
    text-align: right;
}