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

Px/em to rem #187

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Px/em to rem #187

merged 2 commits into from
Oct 18, 2024

Conversation

ohp-inmeta
Copy link
Contributor

@ohp-inmeta ohp-inmeta commented Oct 17, 2024

Update all css-files to use rem (where appropriate)
Added border-box to all elements

Describe your changes

  • Replace px and em with rem where appropriate. Borders, outline, max- and min-widths and such are still in px, but font-sizes, paddings/margins, sizes, etc are now in rem.
  • Enforce box-sizing: border-box; on all elements, unless set explicitly

Checklist before requesting a review

  • I have performed a self-review and test of my code
  • I have added label to the PR (major, minor or patch)
  • If new component: Is story for component created in stories-folder?
  • If new component: Is tsx-file import added to packages/react/index.tsx?
  • If new component: Is css-file added to packages/css/index.css?

Update all scss-files to use rem (where appropriate)
@ohp-inmeta ohp-inmeta requested a review from a team as a code owner October 17, 2024 11:03
Copy link
Contributor

Please set a versioning label of either major, minor, or patch to the pull request.

@ohp-inmeta ohp-inmeta self-assigned this Oct 17, 2024
@aurorascharff
Copy link
Contributor

Testet branchen i eget prosjekt som beskrevet her:

https://github.com/miljodir/md-components/blob/main/README.md#teste-endringer-i-eget-prosjekt

Ting ser likt ut som før for min del :)

Copy link

@mikaelinmeta mikaelinmeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Koden ser bra ut :)

@kajsaeggum
Copy link
Contributor

Nå som border-box er innført (🥳 ), er det en del css som trengs å ryddes opp i.

F.eks. i select-komponent settes bredden på dropdown til (select.css linje 118):
width: calc(100% - 4px); /* Full width minus border-width */
Dette måtte til før, for at knappen og dropdown skulle være like bred, men nå bør det bare stå 100%, for å unngå dette:
image

Et kjapt søk på "calc" i repoet viser flere steder som har 100% - X, som jeg mistenker er av samme grunn.

@ohp-inmeta
Copy link
Contributor Author

@kajsaeggum Det skal jeg få kikka på!

after setting border-box on all elements, we can remove border-compensation for widths
@ohp-inmeta ohp-inmeta merged commit 571d0b5 into main Oct 18, 2024
3 checks passed
@ohp-inmeta ohp-inmeta deleted the 106-switch-to-rem branch October 18, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants