Skip to content

Best practice for setting box-sizing: border-box, taken from css-tricks

License

Notifications You must be signed in to change notification settings

strarsis/box-sizing-border-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

box-sizing-border-box

Best practice for setting box-sizing: border-box.

From https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ .

Installation

Using npm: npm install --save-dev box-sizing-border-box

Using yarn: yarn add --dev box-sizing-border-box

What's inside?

See https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ .

html {
  box-sizing: border-box;
}

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

Usage

webpack (SCSS) + node_modules loader

@import "~box-sizing-border-box";

eyeglass (SCSS):

@import 'box-sizing-border-box';