diff --git a/packages/ffe-form-react/src/BaseRadioButton.js b/packages/ffe-form-react/src/BaseRadioButton.js index 8bc2629963..e9d3c4bc2e 100644 --- a/packages/ffe-form-react/src/BaseRadioButton.js +++ b/packages/ffe-form-react/src/BaseRadioButton.js @@ -55,7 +55,7 @@ class BaseRadioButton extends Component { {...labelProps} className={labelClasses} > - {children} + {children} {tooltip && {tooltip}} diff --git a/packages/ffe-form/less/checkbox.less b/packages/ffe-form/less/checkbox.less index b696dad0dd..27439a5e47 100644 --- a/packages/ffe-form/less/checkbox.less +++ b/packages/ffe-form/less/checkbox.less @@ -1,4 +1,7 @@ .ffe-checkbox { + --line-height: 1.15rem; + + line-height: var(--line-height); display: grid; grid-column-gap: @ffe-spacing-sm; align-items: center; @@ -12,9 +15,11 @@ -webkit-tap-highlight-color: fade(@ffe-farge-vann, 15%); color: var(--ffe-v-input-color); grid-template-columns: auto 1fr; + grid-template-rows: var(--line-height) 1fr; .ffe-checkbox__content { grid-column: 2/3; + grid-row: 1/-1; } &--no-margin { @@ -32,7 +37,7 @@ place-self: center; content: ''; grid-column: 1/2; - grid-row: 1/-1; + grid-row: 1/2; } &::before { diff --git a/packages/ffe-form/less/radio-button.less b/packages/ffe-form/less/radio-button.less index 3aa5c8bdd7..09cfbd92af 100644 --- a/packages/ffe-form/less/radio-button.less +++ b/packages/ffe-form/less/radio-button.less @@ -1,8 +1,11 @@ .ffe-radio-button { + --line-height: 1.15rem; + + line-height: var(--line-height); word-break: break-all; font-family: var(--ffe-g-font); font-variant-numeric: tabular-nums; - display: flex; + display: grid; align-items: center; position: relative; color: var(--ffe-g-text-color); @@ -13,10 +16,13 @@ padding-left: @ffe-spacing-lg; padding-top: 1px; -webkit-tap-highlight-color: fade(@ffe-farge-vann, 15%); + grid-template-columns: auto 1fr; + grid-template-rows: var(--line-height) 1fr; + grid-column-gap: @ffe-spacing-sm; &--inline, &--with-tooltip { - display: inline-flex; + display: inline-grid; margin-right: @ffe-spacing-md; } @@ -56,8 +62,9 @@ height: 20px; border-radius: 50%; pointer-events: none; - position: absolute; left: 0; + grid-column: 1/2; + grid-row: 1/2; } &::before { @@ -127,3 +134,8 @@ border-color: var(--ffe-g-error-color); } } + +.ffe-radio-input__content { + grid-column: 2/3; + grid-row: 1/-1; +}