Skip to content

Commit

Permalink
Cleam up blank underline block
Browse files Browse the repository at this point in the history
  • Loading branch information
Lindsay Wardell committed Jan 12, 2024
1 parent 8362408 commit 4e22242
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/Nri/Ui/Block/V6.elm
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,16 @@ render config =
, backgroundColor = palette.backgroundColor
, maybeMarker = maybeMark
, labelPosition = config.labelPosition
, labelCss = config.labelCss
, labelCss =
config.labelCss
++ (case ( config.borderStyle, config.content ) of
( Underline, [ Blank _ ] ) ->
[ Css.top (Css.px 6)
]

_ ->
[]
)
, labelId = config.labelId
, labelContentId = Maybe.map labelContentId config.labelId
}
Expand All @@ -721,14 +730,19 @@ viewBlank : BorderStyle -> BlankHeight -> CharacterWidth -> Html msg
viewBlank borderStyle blankHeight (CharacterWidth width) =
let
heightStyles =
case blankHeight of
BlankHeightFull ->
[ Css.paddingTop topBottomSpace
, Css.paddingBottom topBottomSpace
, Css.lineHeight Css.initial
]
case borderStyle of
Dashed ->
case blankHeight of
BlankHeightFull ->
[ Css.paddingTop topBottomSpace
, Css.paddingBottom topBottomSpace
, Css.lineHeight Css.initial
]

BlankHeightInline ->
BlankHeightInline ->
[ Css.lineHeight (Css.num 1) ]

Underline ->
[ Css.lineHeight (Css.num 1) ]
in
span
Expand All @@ -738,7 +752,7 @@ viewBlank borderStyle blankHeight (CharacterWidth width) =
Css.border3 (Css.px 2) Css.dashed Colors.navy

Underline ->
Css.borderBottom2 (Css.px 2) Css.solid
Css.borderBottom2 (Css.px 1) Css.solid
, MediaQuery.highContrastMode
[ Css.property "border-color" "CanvasText"
, Css.property "background-color" "Canvas"
Expand Down

0 comments on commit 4e22242

Please sign in to comment.