(
>
{icon ? (
- {/* TODO: can link to CSS Var? var(--eds-size-1-and-half) */}
+ {/* TODO: can link to CSS Var? calc(var(--eds-size-1-and-half) / 16 * 1rem) */}
) : (
diff --git a/src/components/ProgressBar/ProgressBar.module.css b/src/components/ProgressBar/ProgressBar.module.css
index 3e7974438..dc2ddf84d 100644
--- a/src/components/ProgressBar/ProgressBar.module.css
+++ b/src/components/ProgressBar/ProgressBar.module.css
@@ -9,8 +9,8 @@
*/
.progress-bar {
border: var(--eds-theme-color-progress-bar-border) solid
- var(--eds-border-width-sm);
- border-radius: var(--eds-border-radius-full);
+ calc(var(--eds-border-width-sm) * 1px);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
/* Prevents child segments from clipping outside the borders */
overflow: hidden;
@@ -26,7 +26,7 @@
*/
.progress-bar__segments-wrapper {
display: flex;
- gap: var(--eds-size-half);
+ gap: calc(var(--eds-size-half) / 16 * 1rem);
height: 100%;
}
@@ -47,7 +47,7 @@
justify-content: space-between;
align-items: center;
- margin-bottom: var(--eds-size-1);
+ margin-bottom: calc(var(--eds-size-1) / 16 * 1rem);
}
/**
diff --git a/src/components/Radio/Radio-v2.module.css b/src/components/Radio/Radio-v2.module.css
index f1cf41efc..935155188 100755
--- a/src/components/Radio/Radio-v2.module.css
+++ b/src/components/Radio/Radio-v2.module.css
@@ -128,12 +128,12 @@
.radio__input:focus-visible + .radio__icon {
border: 0.125rem solid var(--eds-theme-color-border-utility-focus);
- border-radius: var(--eds-border-radius-full);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
@supports not selector(:focus-visible) {
.radio__input:focus + .radio__icon {
border: 0.125rem solid var(--eds-theme-color-border-utility-focus);
- border-radius: var(--eds-border-radius-full);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
}
diff --git a/src/components/Radio/Radio.module.css b/src/components/Radio/Radio.module.css
index 8b4a9cb76..51a213c36 100755
--- a/src/components/Radio/Radio.module.css
+++ b/src/components/Radio/Radio.module.css
@@ -7,7 +7,7 @@
*/
.radio {
display: flex;
- gap: var(--eds-size-1);
+ gap: calc(var(--eds-size-1) / 16 * 1rem);
}
/**
@@ -29,10 +29,10 @@
margin: 0;
/* Remove the radio from the page flow, positioning it on top of the SVG. */
position: absolute;
- left: var(--eds-size-half);
+ left: calc(var(--eds-size-half) / 16 * 1rem);
/* Set same dimensions as the RadioSvg element. */
- height: var(--eds-size-2);
- width: var(--eds-size-2);
+ height: calc(var(--eds-size-2) / 16 * 1rem);
+ width: calc(var(--eds-size-2) / 16 * 1rem);
/**
* Hide the input element visually.
* This ensures the radio is still "physically" present so that all users,
@@ -48,17 +48,17 @@
.radio__icon {
color: var(--eds-theme-color-radio-brand-background);
/* Creates space for the border so that there's no jitter when the focus border is visible. */
- border: var(--eds-border-width-sm) solid transparent;
+ border: calc(var(--eds-border-width-sm) * 1px) solid transparent;
}
.radio__input:focus-visible + .radio__icon {
- border: var(--eds-border-width-sm) solid var(--eds-theme-color-focus-ring);
- border-radius: var(--eds-border-radius-full);
+ border: calc(var(--eds-border-width-sm) * 1px) solid var(--eds-theme-color-focus-ring);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
@supports not selector(:focus-visible) {
.radio__input:focus + .radio__icon {
- border: var(--eds-border-width-sm) solid var(--eds-theme-color-focus-ring);
- border-radius: var(--eds-border-radius-full);
+ border: calc(var(--eds-border-width-sm) * 1px) solid var(--eds-theme-color-focus-ring);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
}
@@ -89,7 +89,7 @@
* Used for centering the label with the radio input button.
*/
.radio__label--md {
- top: var(--eds-size-quarter);
+ top: calc(var(--eds-size-quarter) / 16 * 1rem);
}
.radio__label--lg {
/* This is a 1px increase in top spacing from the md variant. Size is too specific to have a token. */
diff --git a/src/components/SearchBar/SearchBar.module.css b/src/components/SearchBar/SearchBar.module.css
index e20281db0..0d69f4671 100644
--- a/src/components/SearchBar/SearchBar.module.css
+++ b/src/components/SearchBar/SearchBar.module.css
@@ -7,7 +7,7 @@
*/
.search-bar {
display: flex;
- gap: var(--eds-size-1);
+ gap: calc(var(--eds-size-1) / 16 * 1rem);
}
/**
@@ -16,7 +16,7 @@
.search-button {
padding-top: 1px;
padding-bottom: 1px;
- height: var(--eds-size-5);
+ height: calc(var(--eds-size-5) / 16 * 1rem);
box-sizing: content-box;
border: 0;
}
diff --git a/src/components/Section/Section.module.css b/src/components/Section/Section.module.css
index 063d65591..8d8d86672 100755
--- a/src/components/Section/Section.module.css
+++ b/src/components/Section/Section.module.css
@@ -8,8 +8,8 @@
* A section is a discrete section of a web page.
*/
.section {
- padding-top: var(--eds-size-4);
- padding-bottom: var(--eds-size-4);
+ padding-top: calc(var(--eds-size-4) / 16 * 1rem);
+ padding-bottom: calc(var(--eds-size-4) / 16 * 1rem);
}
/**
@@ -21,8 +21,8 @@
display: flex;
flex-direction: row;
justify-content: flex-start;
- gap: var(--eds-size-1);
- margin-bottom: var(--eds-size-3);
+ gap: calc(var(--eds-size-1) / 16 * 1rem);
+ margin-bottom: calc(var(--eds-size-3) / 16 * 1rem);
/**
* Section header within centered section
@@ -45,7 +45,7 @@
flex-grow: 1;
display: flex;
flex-direction: row;
- gap: var(--eds-size-1);
+ gap: calc(var(--eds-size-1) / 16 * 1rem);
/* To center the header, flex-grow must be disabled. */
.section--center & {
flex-grow: 0;
@@ -102,7 +102,7 @@
*/
.section__overline {
margin-top: 0;
- margin-bottom: var(--eds-size-1);
+ margin-bottom: calc(var(--eds-size-1) / 16 * 1rem);
}
/**
@@ -111,7 +111,7 @@
* Optional string that appears beneath the section title.
*/
.section__description {
- margin-top: var(--eds-size-half);
+ margin-top: calc(var(--eds-size-half) / 16 * 1rem);
margin-bottom: 0;
}
diff --git a/src/components/Select/Select-v2.module.css b/src/components/Select/Select-v2.module.css
index d70568fec..c95aa4051 100644
--- a/src/components/Select/Select-v2.module.css
+++ b/src/components/Select/Select-v2.module.css
@@ -41,7 +41,7 @@
width: 100%;
padding: 0.5rem;
- border: var(--eds-border-width-sm) solid;
+ border: calc(var(--eds-border-width-sm) * 1px) solid;
border-radius: calc(var(--eds-theme-border-radius-objects-sm) * 1px);
display: flex;
@@ -62,7 +62,7 @@
flex-shrink: 0;
transform: rotate(0);
- transition: transform var(--eds-anim-move-medium) ease-out;
+ transition: transform calc(var(--eds-anim-move-medium) * 1s) ease-out;
@media (prefers-reduced-motion) {
transition: none;
@@ -122,7 +122,7 @@
.select-button:focus-visible {
border-color: var(--eds-theme-color-border-utility-focus);
- outline: var(--eds-border-width-sm) solid var(--eds-theme-color-border-utility-focus);
+ outline: calc(var(--eds-border-width-sm) * 1px) solid var(--eds-theme-color-border-utility-focus);
}
.select-button--error {
@@ -134,7 +134,7 @@
&:focus-visible {
border-color: var(--eds-theme-color-border-utility-critical);
- outline: var(--eds-border-width-sm) solid var(--eds-theme-color-border-utility-critical);
+ outline: calc(var(--eds-border-width-sm) * 1px) solid var(--eds-theme-color-border-utility-critical);
}
}
@@ -147,6 +147,6 @@
&:focus-visible {
border-color: var(--eds-theme-color-border-utility-warning);
- outline: var(--eds-border-width-sm) solid var(--eds-theme-color-border-utility-warning);
+ outline: calc(var(--eds-border-width-sm) * 1px) solid var(--eds-theme-color-border-utility-warning);
}
}
\ No newline at end of file
diff --git a/src/components/Select/Select.module.css b/src/components/Select/Select.module.css
index e9ddfae19..92ee64568 100644
--- a/src/components/Select/Select.module.css
+++ b/src/components/Select/Select.module.css
@@ -29,7 +29,7 @@
.select__overline {
display: flex;
justify-content: space-between;
- margin-bottom: var(--eds-size-half);
+ margin-bottom: calc(var(--eds-size-half) / 16 * 1rem);
color: var(--eds-theme-color-form-label);
}
@@ -75,12 +75,12 @@
font-size: inherit;
color: var(--eds-theme-color-text-neutral-subtle);
- height: var(--eds-size-5);
+ height: calc(var(--eds-size-5) / 16 * 1rem);
width: 100%;
- padding: 0 var(--eds-size-2);
+ padding: 0 calc(var(--eds-size-2) / 16 * 1rem);
- border: var(--eds-theme-border-width) solid var(--eds-theme-color-form-border);
- border-radius: var(--eds-border-radius-md);
+ border: calc(var(--eds-theme-border-width) * 1px) solid var(--eds-theme-color-form-border);
+ border-radius: calc(var(--eds-border-radius-md) * 1px);
display: flex;
/* Place button text on the left and the expand more icon on the right. */
@@ -110,7 +110,7 @@
flex-shrink: 0;
transform: rotate(0);
- transition: transform var(--eds-anim-move-medium) ease-out;
+ transition: transform calc(var(--eds-anim-move-medium) * 1s) ease-out;
@media (prefers-reduced-motion) {
/* Turns off animation if user prefers reduced motion. */
transition: none;
diff --git a/src/components/Skeleton/Skeleton.module.css b/src/components/Skeleton/Skeleton.module.css
index 7ccc4ae5f..cf319fb27 100644
--- a/src/components/Skeleton/Skeleton.module.css
+++ b/src/components/Skeleton/Skeleton.module.css
@@ -15,7 +15,7 @@
* Skeleton
*/
.skeleton {
- border-radius: var(--eds-border-radius-lg);
+ border-radius: calc(var(--eds-border-radius-lg) * 1px);
background-color: var(--eds-theme-color-background-neutral-medium);
background-image: linear-gradient(
to right,
@@ -30,7 +30,7 @@
}
.skeleton.skeleton-circle {
- border-radius: var(--eds-border-radius-full);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
@media screen and (prefers-reduced-motion: reduce) {
diff --git a/src/components/Slider/Slider.module.css b/src/components/Slider/Slider.module.css
index da9c55835..41298740d 100644
--- a/src/components/Slider/Slider.module.css
+++ b/src/components/Slider/Slider.module.css
@@ -10,7 +10,7 @@
.slider {
display: flex;
flex-direction: column;
- gap: var(--eds-size-1-and-half);
+ gap: calc(var(--eds-size-1-and-half) / 16 * 1rem);
}
/**
@@ -39,7 +39,7 @@
appearance: none;
background: transparent;
- height: var(--eds-theme-size-slider-thumb);
+ height: calc(var(--eds-theme-size-slider-thumb) / 16 * 1rem);
}
.slider__input:focus {
outline: none;
@@ -61,8 +61,8 @@
*/
.slider__input::-webkit-slider-runnable-track {
background: var(--slider-track-background);
- height: var(--eds-theme-size-slider-track-height);
- border-radius: var(--eds-border-radius-full);
+ height: calc(var(--eds-theme-size-slider-track-height) / 16 * 1rem);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
/**
* Slider Input Track
@@ -70,23 +70,23 @@
/* Firefox */
.slider__input::-moz-range-track {
background: var(--slider-track-background);
- height: var(--eds-theme-size-slider-track-height);
- border-radius: var(--eds-border-radius-full);
+ height: calc(var(--eds-theme-size-slider-track-height) / 16 * 1rem);
+ border-radius: calc(var(--eds-border-radius-full) / 16 * 1px);
}
/* Chrome, Safari, Edge Chromium */
.slider__input::-webkit-slider-thumb {
appearance: none;
- height: var(--eds-theme-size-slider-thumb);
- width: var(--eds-theme-size-slider-thumb);
+ height: calc(var(--eds-theme-size-slider-thumb) / 16 * 1rem);
+ width: calc(var(--eds-theme-size-slider-thumb) / 16 * 1rem);
background: var(--eds-theme-color-text-neutral-default-inverse);
- border: var(--eds-border-width-md) solid var(--eds-theme-color-border-neutral-default);
- border-radius: var(--eds-border-radius-full);
+ border: calc(var(--eds-border-width-md) * 1px) solid var(--eds-theme-color-border-neutral-default);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
/* Centers thumb on the track */
/* prettier-ignore */
- margin-top: calc(var(--eds-theme-size-slider-track-height) / 2 - var(--eds-theme-size-slider-thumb) / 2);
+ margin-top: calc((var(--eds-theme-size-slider-track-height) / 2 - var(--eds-theme-size-slider-thumb) / 2) / 16 * 1rem);
}
.slider__input:not(:disabled)::-webkit-slider-thumb {
cursor: grab;
@@ -111,11 +111,11 @@
.slider__input::-moz-range-thumb {
box-sizing: border-box;
- height: var(--eds-theme-size-slider-thumb);
- width: var(--eds-theme-size-slider-thumb);
+ height: calc(var(--eds-theme-size-slider-thumb) / 16 * 1rem);
+ width: calc(var(--eds-theme-size-slider-thumb) / 16 * 1rem);
background: var(--eds-theme-color-text-neutral-default-inverse);
- border: var(--eds-border-width-md) solid var(--eds-theme-color-border-neutral-default);
- border-radius: var(--eds-border-radius-full);
+ border: calc(var(--eds-border-width-md) * 1px) solid var(--eds-theme-color-border-neutral-default);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
.slider__input:not(:disabled)::-moz-range-thumb {
cursor: grab;
@@ -143,8 +143,8 @@
color: var(--eds-theme-color-text-neutral-default);
/* Calculates offset of the markers to align with actual values */
- padding-left: calc(var(--eds-theme-size-slider-thumb) / 2);
- padding-right: calc(var(--eds-theme-size-slider-thumb) / 2);
+ padding-left: calc(var(--eds-theme-size-slider-thumb) / 16 / 2 * 1rem);
+ padding-right: calc(var(--eds-theme-size-slider-thumb) / 16 / 2 * 1rem);
}
/**
diff --git a/src/components/TabGroup/TabGroup.module.css b/src/components/TabGroup/TabGroup.module.css
index 7a4984d6c..3c80f7d0a 100644
--- a/src/components/TabGroup/TabGroup.module.css
+++ b/src/components/TabGroup/TabGroup.module.css
@@ -65,7 +65,7 @@
list-style: none;
display: flex;
gap: 0.5rem;
- border-bottom: var(--eds-theme-border-width) solid
+ border-bottom: calc(var(--eds-theme-border-width) * 1px) solid
var(--eds-theme-color-border-utility-default-low-emphasis);
font: var(--eds-theme-typography-tab-lg);
line-height: 1.429;
@@ -140,9 +140,9 @@
white-space: nowrap;
text-overflow: ellipsis;
- transition: color var(--eds-anim-fade-quick) var(--eds-anim-ease),
- box-shadow var(--eds-anim-fade-quick) var(--eds-anim-ease),
- background-color var(--eds-anim-fade-quick) var(--eds-anim-ease);
+ transition: color calc(var(--eds-anim-fade-quick) * 1s) var(--eds-anim-ease),
+ box-shadow calc(var(--eds-anim-fade-quick) * 1s) var(--eds-anim-ease),
+ background-color calc(var(--eds-anim-fade-quick) * 1s) var(--eds-anim-ease);
&:focus-visible {
box-shadow: inset 0 0 0 0.125rem var(--eds-theme-color-border-utility-focus);
@@ -175,9 +175,9 @@
}
.tab__highlight {
- border-radius: var(--eds-border-radius-full);
- transition: bottom var(--eds-anim-fade-quick) var(--eds-anim-ease),
- width var(--eds-anim-fade-quick) var(--eds-anim-ease);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
+ transition: bottom calc(var(--eds-anim-fade-quick) * 1s) var(--eds-anim-ease),
+ width calc(var(--eds-anim-fade-quick) * 1s) var(--eds-anim-ease);
.tabs__item.eds-is-active & {
position: absolute;
@@ -192,7 +192,7 @@
bottom: 0.25rem;
width: calc(100% - 0.5rem);
- border-radius: var(--eds-border-radius-full);
+ border-radius: calc(var(--eds-border-radius-full) * 1px);
}
.tabs--has-divider & {
diff --git a/src/components/Table/Table.module.css b/src/components/Table/Table.module.css
index 70ab09333..f50561a1e 100755
--- a/src/components/Table/Table.module.css
+++ b/src/components/Table/Table.module.css
@@ -17,7 +17,7 @@
:where(.table-cell) {
font: var(--eds-theme-typography-body-sm);
- padding: var(--eds-size-2) var(--eds-size-1);
+ padding: calc(var(--eds-size-2) / 16 * 1rem) calc(var(--eds-size-1) / 16 * 1rem);
}
/**
@@ -26,7 +26,7 @@
*/
:where(.table-header-cell) {
font: var(--eds-theme-typography-label-sm);
- padding: var(--eds-size-1) var(--eds-size-1);
+ padding: calc(var(--eds-size-1) / 16 * 1rem) calc(var(--eds-size-1) / 16 * 1rem);
text-align: left;
}
@@ -36,7 +36,7 @@
* Adjusts the padding to match the table__cell padding for alignment.
*/
.table-header-cell--body {
- padding: var(--eds-size-2) var(--eds-size-1);
+ padding: calc(var(--eds-size-2) / 16 * 1rem) calc(var(--eds-size-1) / 16 * 1rem);
}
/**
@@ -45,7 +45,7 @@
* On table header cells that are sortable, the content is wrapped by a