Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 8

...

The default (original) box model used by browsers leaves a lot to be desired. When you specify something like:

...

Code Block
languagecss
height: 100px;
width: 200px;
padding: 10px;
border: 2px solid black;

theĀ actual width of the element is padding + border + width. The same applies to height: padding + border + height. This makes defining the actual size of element very hard because adding a border means decreasing the size if the element's size needs to be constant. It also causes huge problems with things like "width: 100%" because those cannot have border nor padding: it would make the element exceed the 100% width causing those annoying scroll bars.

...

The script used for this is in _core.scss, and applies the following:

...

Code Block
languagecss
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}


This sets all tags to use border-box sizing by default, and makes it inherit so that changes made locally (should) percolate through.

...