Merge pull request #1587 from NoRedInk/quokka/get-correct-background-colors-for-underline

Correctly display a transparent background for underline blanks
This commit is contained in:
Lindsay Wardell 2024-01-05 13:10:45 -08:00 committed by GitHub
commit 6be3b640db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,8 +24,9 @@ module Nri.Ui.Block.V6 exposing
## Patch changes
Add renderReadAloud
Add border styles `dashed` and `underline`
- Add renderReadAloud
- Add border styles `dashed` and`underline`
- Correctly display a transparent background for underline blanks
@docs view, renderReadAloud, Attribute
@ -737,12 +738,19 @@ viewBlank borderStyle blankHeight (CharacterWidth width) =
Css.border3 (Css.px 2) Css.dashed Colors.navy
Underline ->
Css.borderBottom3 (Css.px 2) Css.solid Colors.navy
Css.borderBottom2 (Css.px 2) Css.solid
, MediaQuery.highContrastMode
[ Css.property "border-color" "CanvasText"
, Css.property "background-color" "Canvas"
]
, Css.backgroundColor Colors.white
, Css.backgroundColor
(case borderStyle of
Dashed ->
Colors.white
Underline ->
Css.rgba 0 0 0 0
)
, Css.width <| Css.em (min 30 <| max 0.83 (toFloat width * 0.5))
, Css.display Css.inlineBlock
, Css.borderRadius