Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Oppdatert bruk av REM i komponenter for forbedret utrykk ved font-scaling i browser #2126

Merged
merged 11 commits into from
Aug 4, 2023
5 changes: 5 additions & 0 deletions .changeset/blue-walls-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

Oppdatert bruk av REM i komponenter for forbedret utrykk ved font-scaling i browser
4 changes: 2 additions & 2 deletions @navikt/core/css/chips.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
padding: 0 var(--a-spacing-3);
text-decoration: none;
border-radius: var(--a-border-radius-full);
min-height: 32px;
min-height: 2rem;
}

.navds-chips--small .navds-chips__chip {
min-height: 24px;
min-height: 1.5rem;
padding: 0 var(--a-spacing-2);
}

Expand Down
4 changes: 2 additions & 2 deletions @navikt/core/css/copybutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
.navds-copybutton__icon {
font-size: 1.5rem;
display: flex;
margin-left: -4px;
margin-left: -0.25rem;
}

.navds-copybutton__icon:only-child {
margin: 0;
}

:where(.navds-copybutton--small, .navds-copybutton--xsmall):where(:not(:only-child)) {
margin: -2px;
margin: -0.125rem;
}

.navds-copybutton:focus-visible {
Expand Down
5 changes: 2 additions & 3 deletions @navikt/core/css/date.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@

.navds-date__field-button {
position: absolute;
right: 1px;
right: 0.0625rem;
top: 50%;
transform: translateY(-50%);
color: var(--ac-date-input-button-text, var(--a-text-default));
Expand All @@ -238,7 +238,7 @@
align-items: center;
justify-content: center;
font-size: 1.5rem;
height: calc(100% - 2px);
height: calc(100% - 0.125rem);
border-start-start-radius: 0;
border-end-start-radius: 0;
}
Expand Down Expand Up @@ -284,7 +284,6 @@
}

/* Readonly */

.navds-date__field--readonly .navds-date__field-button {
cursor: default;
}
2 changes: 1 addition & 1 deletion @navikt/core/css/expansioncard.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
*************************/

.navds-expansioncard__title--small {
margin-top: 10px;
margin-top: 0.625rem;
}

.navds-expansioncard__title--medium {
Expand Down
8 changes: 4 additions & 4 deletions @navikt/core/css/form/combobox.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
flex-direction: row;
justify-content: space-between;
width: 100%;
border: 1px solid black;
border: 1px solid var(--a-border-default);
}

.navds-combobox__wrapper-inner > :first-child {
Expand Down Expand Up @@ -52,7 +52,7 @@
letter-spacing: 0;
line-height: var(--a-font-line-height-large);
margin: 0;
padding-left: calc(0.5rem - 4px);
padding-left: 0.25rem;
}

.navds-combobox__input-wrapper {
Expand Down Expand Up @@ -190,8 +190,8 @@
align-items: flex-start;
padding: 0;
box-shadow: var(--a-shadow-small);
border-radius: 4px;
gap: 4px 0;
border-radius: var(--a-border-radius-medium);
gap: var(--a-spacing-1) 0;
background-color: var(--ac-combobox-list-bg, var(--a-surface-default));
color: var(--ac-combobox-list-text, var(--a-text-default));
}
Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/css/form/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

.navds-form-field__description {
margin-top: -6px;
margin-top: -0.375rem;
color: var(--ac-form-description, var(--a-text-subtle));
}

Expand Down
20 changes: 10 additions & 10 deletions @navikt/core/css/form/radio-checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
.navds-checkbox__input,
.navds-radio__input {
position: absolute;
width: 48px;
height: 48px;
width: 3rem;
height: 3rem;
top: 0;
left: -12px;
left: -0.75rem;
z-index: 1;
opacity: 0;
cursor: pointer;
Expand Down Expand Up @@ -51,15 +51,15 @@

.navds-checkbox--small > .navds-checkbox__input,
.navds-radio--small > .navds-radio__input {
width: 32px;
height: 32px;
width: 2rem;
height: 2rem;
top: 0;
left: -6px;
left: -0.375rem;
}

.navds-checkbox--small > .navds-checkbox__label,
.navds-radio--small > .navds-radio__label {
padding: 6px 0;
padding: 0.375rem 0;
}

.navds-checkbox--small > .navds-checkbox__label::before,
Expand Down Expand Up @@ -115,15 +115,15 @@

.navds-checkbox__input:checked + .navds-checkbox__label::before {
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMyAxMCI+ICAgIDxnPiAgICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNNCwxMGMtMC40LDAtMC44LTAuMS0xLjEtMC40TDAuNCw3LjFDMC4xLDYuOCwwLDYuNCwwLDZzMC4yLTAuOCwwLjUtMS4xQzEsNC40LDIsNC40LDIuNSw0LjlMNCw2LjRsNi40LTYgICAgQzEwLjgsMC4xLDExLjEsMCwxMS41LDBjMC40LDAsMC44LDAuMiwxLDAuNWMwLjYsMC42LDAuNSwxLjYtMC4xLDIuMXYwTDUsOS42QzQuNyw5LjksNC40LDEwLDQsMTB6IE0xMS44LDEuOUwxMS44LDEuOSAgICBDMTEuOCwxLjksMTEuOCwxLjksMTEuOCwxLjl6IE0xMS4yLDEuMUMxMS4yLDEuMSwxMS4yLDEuMSwxMS4yLDEuMUwxMS4yLDEuMXoiLz4gICAgPC9nPjwvc3ZnPg==);
background-position: 6px center;
background-position: 0.375rem center;
background-repeat: no-repeat;
background-size: 13px;
background-size: 0.8125rem;
box-shadow: none;
background-color: var(--ac-radio-checkbox-action, var(--a-surface-action));
}

.navds-checkbox--small > .navds-checkbox__input:checked + .navds-checkbox__label::before {
background-position: 4px center;
background-position: 0.25rem center;
}

.navds-checkbox__input:indeterminate:focus-visible + .navds-checkbox__label::before,
Expand Down
6 changes: 3 additions & 3 deletions @navikt/core/css/form/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@

.navds-search__button-search {
flex-shrink: 0;
min-width: 64px;
min-height: 32px;
min-width: 4rem;
min-height: 2rem;
border-radius: 0;
border-top-right-radius: var(--a-border-radius-medium);
border-bottom-right-radius: var(--a-border-radius-medium);
Expand All @@ -116,7 +116,7 @@
}

.navds-form-field--small .navds-search__button-search {
min-width: 40px;
min-width: 2.5rem;
}

.navds-search__button-search.navds-button--secondary {
Expand Down
4 changes: 2 additions & 2 deletions @navikt/core/css/form/select.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
color: var(--ac-select-text, var(--a-text-default));
width: 100%;
box-sizing: border-box;
min-height: 48px;
min-height: 3rem;
display: inline-block;
position: relative;
padding: 0.5rem;
Expand Down Expand Up @@ -45,7 +45,7 @@
}

.navds-form-field--small .navds-select__input {
min-height: 32px;
min-height: 2rem;
padding: 0 2rem 0 0.25rem;
}

Expand Down
36 changes: 18 additions & 18 deletions @navikt/core/css/form/switch.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.navds-switch {
position: relative;
min-height: 48px;
min-height: 3rem;
width: fit-content;
}

Expand All @@ -10,22 +10,22 @@

.navds-switch--small {
position: relative;
min-height: 32px;
min-height: 2rem;
}

/* Input */
.navds-switch__input {
cursor: pointer;
position: absolute;
z-index: 1;
width: 48px;
height: 48px;
width: 3rem;
height: 3rem;
opacity: 0;
top: 0;
}

.navds-switch--small > .navds-switch__input {
height: 32px;
height: 2rem;
top: 0;
}

Expand All @@ -47,11 +47,11 @@
}

.navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
padding: calc(var(--a-spacing-2) - 2px) 0 calc(var(--a-spacing-2) - 2px) 3.25rem;
padding: calc(var(--a-spacing-2) - var(--a-spacing-05)) 0 calc(var(--a-spacing-2) - var(--a-spacing-05)) 3.25rem;
}

.navds-switch--right.navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
padding: calc(var(--a-spacing-2) - 2px) 3.25rem calc(var(--a-spacing-2) - 2px) 0;
padding: calc(var(--a-spacing-2) - var(--a-spacing-05)) 3.25rem calc(var(--a-spacing-2) - var(--a-spacing-05)) 0;
}

.navds-switch--with-description,
Expand All @@ -70,8 +70,8 @@

/* Track */
.navds-switch__track {
width: 44px;
height: 24px;
width: 2.75rem;
height: 1.5rem;
background-color: var(--ac-switch-bg, var(--a-surface-neutral));
position: absolute;
top: var(--a-spacing-3);
Expand Down Expand Up @@ -125,30 +125,30 @@
background-color: var(--ac-switch-thumb-bg, var(--a-surface-default));
color: var(--ac-switch-thumb-icon, var(--a-icon-subtle));
border-radius: var(--a-border-radius-full);
width: 20px;
height: 20px;
width: 1.25rem;
height: 1.25rem;
position: absolute;
transform: translateX(0);
left: 2px;
top: 2px;
left: var(--a-spacing-05);
top: var(--a-spacing-05);
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
align-items: center;
justify-content: center;
}

.navds-switch__input:checked ~ .navds-switch__track > .navds-switch__thumb {
transform: translateX(20px);
transform: translateX(1.25rem);
color: var(--ac-switch-thumb-icon-checked, var(--a-icon-success));
}

@media (hover: hover) and (pointer: fine) {
.navds-switch__input:hover ~ .navds-switch__track > .navds-switch__thumb {
transform: translateX(2px);
transform: translateX(0.125rem);
}

.navds-switch__input:checked:hover ~ .navds-switch__track > .navds-switch__thumb {
transform: translateX(18px);
transform: translateX(1.125rem);
}
}

Expand All @@ -157,7 +157,7 @@
}

.navds-switch__input:checked:disabled:hover ~ .navds-switch__track > .navds-switch__thumb {
transform: translateX(20px);
transform: translateX(1.25rem);
}

/* Loader */
Expand Down Expand Up @@ -216,6 +216,6 @@
}

.navds-switch--readonly > .navds-switch__input:checked:hover ~ .navds-switch__track > .navds-switch__thumb {
transform: translateX(20px);
transform: translateX(1.25rem);
}
}
6 changes: 3 additions & 3 deletions @navikt/core/css/form/text-field.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
background-color: var(--ac-textfield-bg, var(--a-surface-default));
border-radius: var(--a-border-radius-medium);
border: 1px solid var(--ac-textfield-border, var(--a-border-default));
min-height: 48px;
min-height: 3rem;
width: 100%;
color: var(--ac-textfield-text, var(--a-text-default));
}
Expand All @@ -27,8 +27,8 @@
}

.navds-form-field--small .navds-text-field__input {
padding: 0 0.5rem;
min-height: 32px;
padding: 0 var(--a-spacing-2);
min-height: 2rem;
}

.navds-text-field__input:hover {
Expand Down
6 changes: 3 additions & 3 deletions @navikt/core/css/form/textarea.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}

.navds-form-field--small .navds-textarea__input {
padding: 6px;
padding: 0.375rem;
}

.navds-form-field--small .navds-textarea--counter.navds-textarea__input {
Expand All @@ -64,8 +64,8 @@
font-style: italic;
position: absolute;
text-align: left;
left: 1px;
bottom: 1px;
left: 0.0625rem;
bottom: 0.0625rem;
padding: var(--a-spacing-1) var(--a-spacing-2);
}

Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/css/internalheader.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
align-self: stretch;
background: var(--ac-internalheader-bg, var(--a-surface-inverted));
min-height: var(--a-spacing-12);
min-height: 3rem;

--navds-internalheader-focus: inset 0 0 0 2px var(--a-border-focus-on-inverted);
}
Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/css/list.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

.navds-list .navds-list__item-marker--bullet {
display: flex;
margin-top: 6px;
margin-top: 0.375rem;
grid-column: 1 / 2;
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
color: var(--ac-list-marker-ul-color, var(--ac-list-marker-color, var(--a-icon-default)));
Expand Down
Loading
Loading