From 7ae964c8300092040583bdc341525c6579f76e5c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 6 Jun 2021 14:47:48 -0400 Subject: 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 --- ext/css/display.css | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'ext/css/display.css') 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; } -- cgit v1.2.3