From 7335a0dd43fa3358b9b6f7994907b38c697980a2 Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Fri, 23 Jun 2017 14:13:22 +0800 Subject: [PATCH] Contextual CSS reset --- src/index.styl | 4 ++++ src/reset-context.styl | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/reset-context.styl diff --git a/src/index.styl b/src/index.styl index c586c44..780a85d 100644 --- a/src/index.styl +++ b/src/index.styl @@ -1,4 +1,8 @@ +@import "reset-context"; + .switch { + reset-context(); + position: relative; display: inline-block; width: 48px; diff --git a/src/reset-context.styl b/src/reset-context.styl new file mode 100644 index 0000000..e5e055c --- /dev/null +++ b/src/reset-context.styl @@ -0,0 +1,9 @@ +reset-context() { + // https://www.paulirish.com/2012/box-sizing-border-box-ftw/ + box-sizing: border-box; + *, *:before, *:after { + box-sizing: inherit; + } + + line-height: 20px; +}