From 2d17a6f44821a6ad5ea5e058896ecb5bc32f7eb4 Mon Sep 17 00:00:00 2001 From: Ben Dansby Date: Mon, 12 Oct 2020 14:50:33 -0700 Subject: [PATCH 1/2] clean up icon styling --- src/Nri/Ui/Button/V10.elm | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Nri/Ui/Button/V10.elm b/src/Nri/Ui/Button/V10.elm index ec30ec62..c3169285 100644 --- a/src/Nri/Ui/Button/V10.elm +++ b/src/Nri/Ui/Button/V10.elm @@ -846,26 +846,16 @@ sizeStyle size width = , Css.Global.descendants [ Css.Global.img [ Css.height (Css.px config.imageHeight) - , Css.marginRight (Css.px <| config.imageHeight / 6) + , Css.width Css.auto + , Css.marginRight (Css.px 5) , Css.position Css.relative - , Css.bottom (Css.px 2) , Css.verticalAlign Css.middle ] , Css.Global.svg - [ Css.height (Css.px config.imageHeight) |> Css.important - , Css.width (Css.px config.imageHeight) |> Css.important - , Css.marginRight (Css.px <| config.imageHeight / 6) + [ Css.height (Css.px config.imageHeight) + , Css.width Css.auto + , Css.marginRight (Css.px 5) , Css.position Css.relative - , Css.bottom (Css.px 2) - , Css.verticalAlign Css.middle - ] - , Css.Global.svg - [ Css.important <| Css.height (Css.px config.imageHeight) - , Css.important <| Css.width Css.auto - , Css.maxWidth (Css.px (config.imageHeight * 1.25)) - , Css.paddingRight (Css.px <| config.imageHeight / 6) - , Css.position Css.relative - , Css.bottom (Css.px 2) , Css.verticalAlign Css.middle ] ] From 9c3a389055d40a21fc4673c9228d361da4899fff Mon Sep 17 00:00:00 2001 From: Ben Dansby Date: Mon, 12 Oct 2020 15:34:04 -0700 Subject: [PATCH 2/2] more cleanup and tweaks --- src/Nri/Ui/Button/V10.elm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Nri/Ui/Button/V10.elm b/src/Nri/Ui/Button/V10.elm index c3169285..4935ef38 100644 --- a/src/Nri/Ui/Button/V10.elm +++ b/src/Nri/Ui/Button/V10.elm @@ -605,6 +605,8 @@ viewLabel maybeSvg label_ = [ Css.overflow Css.hidden -- Keep scrollbars out of our button , Css.overflowWrap Css.breakWord -- Ensure that words that exceed the button width break instead of disappearing , Css.padding2 (Css.px 2) Css.zero -- Without a bit of bottom padding, text that extends below the baseline, like "g" gets cut off + , Css.displayFlex + , Css.alignItems Css.center ] [] (case maybeSvg of @@ -848,15 +850,13 @@ sizeStyle size width = [ Css.height (Css.px config.imageHeight) , Css.width Css.auto , Css.marginRight (Css.px 5) - , Css.position Css.relative - , Css.verticalAlign Css.middle + , Css.flexShrink Css.zero ] , Css.Global.svg [ Css.height (Css.px config.imageHeight) , Css.width Css.auto , Css.marginRight (Css.px 5) - , Css.position Css.relative - , Css.verticalAlign Css.middle + , Css.flexShrink Css.zero ] ] ]