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 box-sizing for consistency across elements #41243

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,27 @@
// Document
//
// Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
//
// Set box-sizing to inherit for all elements so that they inherit the value from their parent element.
// This allows more flexibility and consistency, ensuring that child elements follow the same box-sizing rule as their parent.

*,
*::before,
*::after {
box-sizing: border-box;
box-sizing: inherit;
}


// Root
//
// Set box-sizing to border-box for the root element. This will ensure consistency throughout the document
// entire page uses border-box by default, unless overridden by a parent element.
//
// Ability to the value of the root font sizes, affecting the value of `rem`.
// null by default, thus nothing is generated.

:root {
box-sizing: border-box;

@if $font-size-root != null {
@include font-size(var(--#{$prefix}root-font-size));
}
Expand Down