Created
October 5, 2014 15:49
-
-
Save marioblas/d0deb499e006178647c3 to your computer and use it in GitHub Desktop.
CSS - Inheriting box-sizing Probably Slightly Better Best-Practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inheriting box-sizing Probably Slightly Better Best-Practice. | |
* This will give you the same result, and make it easier to change the box-sizing in plugins or other components that leverage other behavior. | |
* | |
* Reference: http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ | |
*/ | |
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} | |
/* Designed to work in default box-sizing */ | |
/* In your page, you could reset it to normal */ | |
.component { | |
box-sizing: content-box; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment