aboutsummaryrefslogtreecommitdiff
path: root/ext/css/display.css
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-21 13:57:28 -0500
committerGitHub <noreply@github.com>2021-02-21 13:57:28 -0500
commitb7789749380a6e101adbca82c37a55dcd5fe31a4 (patch)
tree529f5e00030b1b8c40fdc67bd6bc7b09cab5cfc4 /ext/css/display.css
parent75d0d333d86d2450db811a89b503bae22a3b49b6 (diff)
Improve tag styles (#1431)
* Update tag styles * Refactor _createTag * Update padding
Diffstat (limited to 'ext/css/display.css')
-rw-r--r--ext/css/display.css102
1 files changed, 58 insertions, 44 deletions
diff --git a/ext/css/display.css b/ext/css/display.css
index e9339ccc..ec117a1c 100644
--- a/ext/css/display.css
+++ b/ext/css/display.css
@@ -674,73 +674,87 @@ button.action-button[data-icon=source-term]::before {
/* Tags */
.tag {
- display: inline-block;
- padding: 0.2em 0.6em 0.3em;
- font-size: var(--tag-font-size);
- font-weight: var(--tag-font-weight);
- line-height: 1.25;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
+ --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;
+ 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: 0.25em;
+ 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);
- background-color: var(--tag-default-background-color);
- border: var(--tag-border-size) var(--tag-border-style) var(--tag-border-color);
- margin-right: 0.375em;
cursor: pointer;
}
+.tag-label-content {
+ font-size: var(--tag-font-size);
+ font-weight: var(--tag-font-weight);
+}
+.tag-body {
+ position: relative;
+ padding: 0 0.375em 0 0.375em;
+}
+.tag-body::before {
+ content: '';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ border-radius: 0.25em;
+ border: var(--tag-border-size) var(--tag-border-style) var(--tag-color);
+ border-left: none;
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.tag-body-content {
+ 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] {
- background-color: var(--tag-name-background-color);
+ --tag-color: var(--tag-name-background-color);
}
.tag[data-category=expression] {
- background-color: var(--tag-expression-background-color);
+ --tag-color: var(--tag-expression-background-color);
}
.tag[data-category=popular] {
- background-color: var(--tag-popular-background-color);
+ --tag-color: var(--tag-popular-background-color);
}
.tag[data-category=frequent] {
- background-color: var(--tag-frequent-background-color);
+ --tag-color: var(--tag-frequent-background-color);
}
.tag[data-category=archaism] {
- background-color: var(--tag-archaism-background-color);
+ --tag-color: var(--tag-archaism-background-color);
}
.tag[data-category=dictionary] {
- background-color: var(--tag-dictionary-background-color);
+ --tag-color: var(--tag-dictionary-background-color);
}
.tag[data-category=frequency] {
- background-color: var(--tag-frequency-background-color);
+ --tag-color: var(--tag-frequency-background-color);
}
.tag[data-category=partOfSpeech] {
- background-color: var(--tag-part-of-speech-background-color);
+ --tag-color: var(--tag-part-of-speech-background-color);
}
.tag[data-category=search] {
- background-color: var(--tag-search-background-color);
+ --tag-color: var(--tag-search-background-color);
}
.tag[data-category=pitch-accent-dictionary] {
- background-color: var(--tag-pitch-accent-dictionary-background-color);
-}
-.tag-inner {
- display: block;
-}
-.tag-details-disambiguation-list::before {
- content: 'Only: ';
-}
-.tag-details-disambiguation-list ruby>rt {
- display: inline;
- font-size: 1em;
-}
-.tag-details-disambiguation-list ruby>rt::before {
- content: '(';
-}
-.tag-details-disambiguation-list ruby>rt::after {
- content: ')';
-}
-.tag-details-disambiguation-list[data-unmatched-expression-count='0'],
-.tag-details-disambiguation-list:not([data-unmatched-expression-count]) {
- display: none;
-}
-.tag-details-disambiguation:not(:last-child)::after {
- content: ', ';
+ --tag-color: var(--tag-pitch-accent-dictionary-background-color);
}