Skip to content

Commit

Permalink
Px/em to rem (#187)
Browse files Browse the repository at this point in the history
* Px/em to rem

Update all css-files to use rem (where appropriate)

* Adjust element widths

after setting border-box on all elements, we can remove border-compensation for widths
  • Loading branch information
ohp-inmeta authored Oct 18, 2024
1 parent a57f00f commit 571d0b5
Show file tree
Hide file tree
Showing 26 changed files with 347 additions and 341 deletions.
32 changes: 16 additions & 16 deletions packages/css/src/accordionitem/accordionitem.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
border: 1px solid var(--mdGreyColor60);
color: var(--mdGreyColor);
font-family: 'Open sans';
margin-bottom: 1em;
margin-bottom: 1rem;
transition: all 0.2s linear;
}

.md-accordion-item.md-accordion-item--rounded {
border-radius: 4px;
border-radius: 0.25rem;
}

.md-accordion-item.md-accordion-item--secondary {
Expand Down Expand Up @@ -52,7 +52,7 @@
padding: 1.5em 1.8em;
cursor: pointer;
text-align: left;
line-height: 24px;
line-height: 1.5rem;
}

.md-accordion-item__header:focus {
Expand All @@ -67,9 +67,9 @@

.md-accordion-item__header .md-accordion-item__header-icon {
position: relative;
width: 12px;
height: 12px;
min-width: 12px;
width: 0.75rem;
height: 0.75rem;
min-width: 0.75rem;
}
.md-accordion-item__header .md-accordion-item__header-icon:before,
.md-accordion-item__header .md-accordion-item__header-icon:after {
Expand All @@ -82,7 +82,7 @@
.md-accordion-item__header .md-accordion-item__header-icon:before {
top: 0;
left: 50%;
width: 2px;
width: 0.125rem;
height: 100%;
margin-left: -1px;
}
Expand All @@ -91,7 +91,7 @@
top: 50%;
left: 0;
width: 100%;
height: 2px;
height: 0.125rem;
margin-top: -1px;
}
.md-accordion-item__header--expanded .md-accordion-item__header-icon:before {
Expand All @@ -102,7 +102,7 @@
}

.md-accordion-item__header-label {
font-size: 20px;
font-size: 1.25rem;
margin-left: 1em;
}
.md-accordion-item__header:hover .md-accordion-item__header-label {
Expand All @@ -111,26 +111,26 @@

/* CONTENT */
.md-accordion-item__content {
padding: 0 1.8em;
padding: 0 1.8rem;
max-height: 0;
overflow: hidden;
transition: all 0.15s linear;
}
.md-accordion-item__content--expanded {
max-height: 5000px;
padding: 1em 1.8em 1.5em 1.8em;
padding: 1rem 1.8rem 1.5rem 1.8rem;
transition: all 0.15s linear;
}

.md-accordion-item__close-button {
display: flex;
gap: 1em;
gap: 1rem;
padding: 0;
background: none;
border: 0;
margin: 2em 0 0 -0.2em;
margin: 2rem 0 0 -0.2rem;
cursor: pointer;
font-size: 16px;
font-size: 1rem;
}

.md-accordion-item__close-button:hover {
Expand All @@ -143,8 +143,8 @@
}

.md-accordion-item__close-button__icon {
height: 20px;
width: 20px;
height: 1.25rem;
width: 1.25rem;
}

/* DISABLED */
Expand Down
8 changes: 4 additions & 4 deletions packages/css/src/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
background-color: #ffffff;
border: 2px solid var(--mdPrimaryColor);
color: var(--mdPrimaryColor);
padding: calc(0.75rem - 2px) calc(1.5rem - 2px);
padding: 0.75rem 1.5rem;
}

.md-button--small.md-button--secondary {
padding: calc(0.4rem - 2px) calc(0.8rem - 2px);
padding: 0.5rem 0.75rem;
}

.md-button--secondary:hover:enabled {
Expand Down Expand Up @@ -116,11 +116,11 @@
border: none;
border-radius: 0.43rem;
color: var(--mdPrimaryColor);
padding: calc(0.75rem - 2px) calc(1.5rem - 2px);
padding: 0.75rem 1.5rem;
}

.md-button--small.md-button--tertiary {
padding: calc(0.4rem - 2px) calc(0.8rem - 2px);
padding: 0.5rem 0.75rem;
}

.md-button--tertiary:hover:enabled {
Expand Down
16 changes: 8 additions & 8 deletions packages/css/src/chips/chips.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
outline: 1px solid var(--mdPrimaryColor);
outline-offset: -1px;
border: none;
border-radius: 10em;
border-radius: 10rem;
color: var(--mdPrimaryColor);
font-weight: 400;
font-family: 'Open sans';
font-size: 1rem;
line-height: 22px;
line-height: 1.375rem;
padding: 0.5rem 1rem;
cursor: pointer;
text-align: left;
Expand Down Expand Up @@ -59,9 +59,9 @@

.md-chip__left-icon {
display: flex;
width: 16px;
height: 16px;
margin-right: 0.66em;
width: 1rem;
height: 1rem;
margin-right: 0.66rem;
}

.md-chip__label {
Expand All @@ -70,7 +70,7 @@

.md-chip__right-icon {
display: flex;
width: 16px;
height: 16px;
margin-left: 0.8em;
width: 1rem;
height: 1rem;
margin-left: 0.8rem;
}
28 changes: 14 additions & 14 deletions packages/css/src/filelist/filelist.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.md-filelist {
display: flex;
flex-direction: column;
gap: 0.5em;
gap: 0.5rem;
}

.md-filelist__file {
display: flex;
justify-content: space-between;
border: 1px solid var(--mdPrimaryColor);
padding: 0.8em 1.1em;
padding: 0.8rem 1.1rem;
font-family: 'Open sans';
background-color: #fff;
transition: background 0.2s linear;
Expand All @@ -21,36 +21,36 @@

.md-filelist__file-label {
display: flex;
gap: 1em;
font-size: 16px;
gap: 1rem;
font-size: 1rem;
}

.md-filelist__file-icon {
width: 32px;
width: 2rem;
}

.md-filelist__file-size {
font-size: 14px;
margin-top: 0.3em;
font-size: 0.875rem;
margin-top: 0.3rem;
}

/* File actions */
.md-filelist__file-actions {
display: flex;
align-items: center;
gap: 1em;
gap: 1rem;
}

.md-filelist__file-actions-button {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
width: 2.5rem;
height: 2.5rem;
background-color: transparent;
border-radius: 100px;
border-radius: 6.25rem;
border: 0;
padding: 0.2em;
padding: 0.2rem;
cursor: pointer;
transition: background 0.1s linear;
}
Expand All @@ -61,6 +61,6 @@
}

.md-filelist__file-action-icon {
width: 20px;
height: 20px;
width: 1.25rem;
height: 1.25rem;
}
Loading

0 comments on commit 571d0b5

Please sign in to comment.