

Read more about native font stacks in this Smashing Magazine article. These system fonts have been designed specifically with today’s devices in mind, with improved rendering on screens, variable font support, and more. For safety, the has a declared background-color, defaulting to #fff.īootstrap utilizes a “native font stack” or “system font stack” for optimum text rendering on every device and OS.This is inherited later by some form elements to prevent font inconsistencies. The also sets a global font-family, font-weight, line-height, and color.This browser default can be overridden by modifying the $font-size-root variable. font-size: 1rem is applied on the for easy responsive type-scaling via media queries while respecting user preferences and ensuring a more accessible approach. No base font-size is declared on the, but 16px is assumed (the browser default).This ensures that the declared width of element is never exceeded due to padding or border. The box-sizing is globally set on every element-including *::before and *::after, to border-box.The and elements are updated to provide better page-wide defaults. This is still in-progress and will take time to fully implement.įor example, consider these :root CSS variables for common styles: That way, even if you don’t use CSS variables, you still have all the power of Sass. Our approach is to take our source Sass variables and transform them into CSS variables. Ultimately Bootstrap 5 will continue to see more CSS variables added over time, in order to provide more real-time customization without the need to always recompile Sass. This adds :root level CSS variables to all bundles, regardless of how many of them are used in that bundle. With v5.1.1, we standardized our required across all our CSS bundles (including bootstrap.css, bootstrap-reboot.css, and bootstrap-grid.css) to include _root.scss. Keep declarations of font-related properties to a minimum, using inherit whenever possible.For easier scaling across device sizes, block elements should use rems for margins.More importantly though, a single direction of margin is a simpler mental model. Vertical margins can collapse, yielding unexpected results. Update some browser default values to use rems instead of ems for scalable component spacing.Here are our guidelines and reasons for choosing what to override in Reboot: For example, we reboot some styles for a simpler baseline and later provide. Additional styling is done only with classes.

Reboot builds upon Normalize, providing many HTML elements with somewhat opinionated styles using only element selectors.
