aboutsummaryrefslogtreecommitdiff
path: root/ext/css/display.css
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-06-06 14:47:48 -0400
committerGitHub <noreply@github.com>2021-06-06 14:47:48 -0400
commit7ae964c8300092040583bdc341525c6579f76e5c (patch)
treef3c0332becac7da07a50d4bda92f5f6ac88a030c /ext/css/display.css
parent3a095b1f6cfe10b4d6cfa2e1c6d1ad3587dcfea2 (diff)
Structured content updates (#1733)
* Add support for imageRendering * Make crisp-edges appearance on Firefox more similar to Chrome * Refactor * Add background option * Move data-image-rendering attribute * Restructure * Organize * Add support for appearance * Update test dictionary * Update tests
Diffstat (limited to 'ext/css/display.css')
-rw-r--r--ext/css/display.css37
1 files changed, 36 insertions, 1 deletions
diff --git a/ext/css/display.css b/ext/css/display.css
index ac9dae0a..45658f19 100644
--- a/ext/css/display.css
+++ b/ext/css/display.css
@@ -1566,6 +1566,8 @@ button.definition-item-expansion-button:focus:focus-visible+.definition-item-con
line-height: 0;
font-size: calc(1em / var(--font-size-no-units));
overflow: hidden;
+}
+.gloss-image-link[data-background=true]>.gloss-image-container {
background-color: var(--gloss-image-background-color);
}
.gloss-image-link {
@@ -1600,6 +1602,18 @@ button.definition-item-expansion-button:focus:focus-visible+.definition-item-con
text-align: center;
padding: 0.25em;
}
+.gloss-image-background {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: var(--text-color);
+
+ --image: none;
+ --icon-size: contain;
+ --icon-image: var(--image);
+}
.gloss-image {
display: inline-block;
vertical-align: top;
@@ -1617,13 +1631,27 @@ button.definition-item-expansion-button:focus:focus-visible+.definition-item-con
.gloss-image:not([src]) {
display: none;
}
-.gloss-image[data-pixelated=true] {
+.gloss-image-link[data-image-rendering=pixelated] .gloss-image,
+.gloss-image-link[data-image-rendering=pixelated] .gloss-image-background {
image-rendering: auto;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: pixelated;
image-rendering: crisp-edges;
}
+.gloss-image-link[data-image-rendering=crisp-edges] .gloss-image,
+.gloss-image-link[data-image-rendering=crisp-edges] .gloss-image-background {
+ image-rendering: auto;
+ image-rendering: -moz-crisp-edges;
+ image-rendering: -webkit-optimize-contrast;
+ image-rendering: crisp-edges;
+}
+:root[data-browser=firefox] .gloss-image-link[data-image-rendering=crisp-edges] .gloss-image,
+:root[data-browser=firefox] .gloss-image-link[data-image-rendering=crisp-edges] .gloss-image-background,
+:root[data-browser=firefox-mobile] .gloss-image-link[data-image-rendering=crisp-edges] .gloss-image,
+:root[data-browser=firefox-mobile] .gloss-image-link[data-image-rendering=crisp-edges] .gloss-image-background {
+ image-rendering: auto;
+}
.gloss-image-link[data-has-aspect-ratio=true] .gloss-image-aspect-ratio-sizer {
display: inline-block;
width: 0;
@@ -1645,6 +1673,13 @@ button.definition-item-expansion-button:focus:focus-visible+.definition-item-con
white-space: pre-line;
}
+.gloss-image-link[data-appearance=monochrome] .gloss-image {
+ visibility: hidden;
+}
+.gloss-image-link:not([data-appearance=monochrome]) .gloss-image-background {
+ display: none;
+}
+
.gloss-image-link[data-size-units=em] .gloss-image-container {
font-size: 1em;
}