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

Refactor hardcoded uses of rem unit #159

Open
mkrause opened this issue Feb 23, 2025 · 0 comments
Open

Refactor hardcoded uses of rem unit #159

mkrause opened this issue Feb 23, 2025 · 0 comments

Comments

@mkrause
Copy link
Collaborator

mkrause commented Feb 23, 2025

There are still a lot of places where we use hardcoded rem units. This makes it harder to integrate Baklava into an app that has a different root font-size (e.g. apps using the font-size: 62.5% trick to get 1rem = 10px). Instead, we should convert these to use spacing tokens, or other suitable units that don't depend on the root styling.

$ grep -r rem src | grep scss | grep -v src/styling | grep -v src/docs | grep -v rem-from-px
src/components/tables/MultiSearch/MultiSearch.scss:    border: 0.2rem solid $neutral-color-1;
src/components/tables/MultiSearch/MultiSearch.scss:      padding: 1rem;
src/components/tables/DataTable/table/DataTable.module.scss:          padding-block-end: 1rem;
src/components/tables/DataTable/table/DataTable.module.scss:        padding: 0.6rem 0;
src/components/tables/DataTable/table/DataTable.module.scss:          padding: 0.6rem 0;
src/components/tables/DataTable/table/DataTable.module.scss:          margin: 1.5rem 0;
src/components/tables/DataTable/table/DataTable.module.scss:          padding: 1.5rem;
src/components/tables/DataTable/table/DataTablePlaceholder.module.scss:      gap: 1rem;
src/components/forms/controls/Select/Select.module.scss:  $bk-select-min-inline-size: 14rem;
src/components/forms/controls/Select/Select.module.scss:    max-block-size: 18rem;
src/components/forms/controls/Select/Select.module.scss:      translate: 0 -1rem;
src/components/forms/controls/Select/Select.module.scss:        translate: 0 -1rem;
src/components/forms/fields/TextAreaField/TextAreaField.module.scss:      --empty: ; // Prevent empty class from being removed
src/components/forms/fields/InputField/InputField.module.scss:      --empty: ; // Prevent empty class from being removed
src/components/util/overlays/modal/ModalProvider.module.scss:    max-inline-size: 30rem;
src/components/overlays/ToastProvider/ToastProvider.module.scss:      margin: 1rem;
src/components/overlays/Tooltip/Tooltip.module.scss:    max-inline-size: 30rem;
src/components/overlays/Tooltip/Tooltip.module.scss:      translate: 0 0.3rem;
src/components/overlays/Tooltip/Tooltip.module.scss:        translate: 0 0.3rem;
src/components/overlays/DropdownMenu/DropdownMenu.module.scss:  $bk-dropdown-menu-min-width: 14rem;
src/components/overlays/DropdownMenu/DropdownMenu.module.scss:    max-block-size: 18rem;
src/components/overlays/DropdownMenu/DropdownMenu.module.scss:        translate: 0 -1rem;
src/components/overlays/DropdownMenu/DropdownMenu.module.scss:            translate: 0 -1rem;
src/components/overlays/DialogModal/DialogModal.module.scss:// Note: `$blur` should be in px, not rem (blur effect should be independent of any font size scaling)
src/components/overlays/DialogModal/DialogModal.module.scss:      inset: 1rem;
src/components/actions/Button/Button.module.scss:    // Experiment: implementing `unstyled` using `revert-layer` rather than by removing the class names
src/components/containers/Disclosure/Disclosure.module.scss:        //block-size: 20rem; // This works
src/components/containers/Disclosure/Disclosure.module.scss:        --summary-block-size: calc(var(--bk-disclosure-padding-block) + 1.6rem);
src/components/containers/Panel/Panel.module.scss:  min-block-size: 4rem;
src/components/containers/Banner/Banner.module.scss:    --bk-banner-indent: calc(#{bk.$spacing-3} + 1.2rem + #{bk.$spacing-2}); // Spacing + icon width + spacing
src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.module.scss:        --bk-icon-size: 6rem;
src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.module.scss:        max-block-size: 5rem;
src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.module.scss:        --bk-icon-size: 4rem;
src/components/graphics/PlaceholderEmpty/PlaceholderEmpty.module.scss:        max-block-size: 3rem;
src/layouts/AppLayout/AppLayout.module.scss:      font-size: 0.8rem;
src/layouts/AppLayout/Header/UserMenu.module.scss:    min-inline-size: 1rem; // Allow it to shrink down to just the icon on small screens
src/layouts/AppLayout/Header/AccountSelector.module.scss:    min-inline-size: 3rem;
src/layouts/AppLayout/Header/AccountSelector.module.scss:      margin-inline-start: -0.2rem;
src/layouts/AppLayout/Header/AccountSelector.module.scss:      margin-block-end: -0.2rem;
src/layouts/AppLayout/Header/SysadminSwitcher.module.scss:    --icon-size: 1.5rem;
src/layouts/AppLayout/Header/SysadminSwitcher.module.scss:      padding-inline-start: 0.1rem;
src/layouts/AppLayout/Header/SysadminSwitcher.module.scss:      padding-inline-start: 0.1rem;
src/layouts/AppLayout/Header/SolutionSelector.module.scss:    min-inline-size: 3rem;
src/layouts/AppLayout/Header/SolutionSelector.module.scss:      margin-inline-start: -0.2rem;
src/layouts/AppLayout/Header/SolutionSelector.module.scss:      margin-block-end: -0.2rem;
src/typography/Prose/Prose.mixins.scss:  font-size: 1rem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant