From a6d69fb85b7d04da189468b8b5706836ce852ee1 Mon Sep 17 00:00:00 2001 From: Brian McAllister Date: Sun, 17 Feb 2013 17:42:04 -0500 Subject: [PATCH] Add an option to control Bootstrap reset output. I'm pretty unfamiliar with the Bootstrap framework, so I'm following along with the existing comments. The goal here is to remove and CSS when a project is not using Bootstrap already. --- sass/font-awesome.scss | 73 ++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/sass/font-awesome.scss b/sass/font-awesome.scss index 3e95005e3..512e10b11 100644 --- a/sass/font-awesome.scss +++ b/sass/font-awesome.scss @@ -36,9 +36,13 @@ Configuration. ---------------------------------- */ +/* Font Awesome. */ $font-awesome-path: '../font' !default; $font-awesome-version: '3.0.2'; +/* Bootstrap. */ +$font-awesome-using-bootstrap: true !default; + /* Colors. */ $font-awesome-border-color: #eee !default; $font-awesome-icon-muted: $font-awesome-border-color !default; @@ -71,8 +75,12 @@ $font-awesome-icon-muted: $font-awesome-border-color !default; font-style: normal; } -/* Font Awesome styles - ------------------------------------------------------- */ + +/** ---------------------------------- + + Main Font Awesome styles. + +---------------------------------- */ [class^="icon-"], [class*=" icon-"] { font-family: FontAwesome; @@ -80,36 +88,45 @@ $font-awesome-icon-muted: $font-awesome-border-color !default; font-style: normal; text-decoration: inherit; -webkit-font-smoothing: antialiased; - - /* sprites.less reset */ - display: inline; - width: auto; - height: auto; - line-height: normal; - vertical-align: baseline; - background-image: none; - background-position: 0% 0%; - background-repeat: repeat; - margin-top: 0; + + /* + Reset sprites.less. + */ + @if $font-awesome-using-bootstrap { + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; + } } -/* more sprites.less reset */ -.icon-white, -.nav-pills > .active > a > [class^="icon-"], -.nav-pills > .active > a > [class*=" icon-"], -.nav-list > .active > a > [class^="icon-"], -.nav-list > .active > a > [class*=" icon-"], -.navbar-inverse .nav > .active > a > [class^="icon-"], -.navbar-inverse .nav > .active > a > [class*=" icon-"], -.dropdown-menu > li > a:hover > [class^="icon-"], -.dropdown-menu > li > a:hover > [class*=" icon-"], -.dropdown-menu > .active > a > [class^="icon-"], -.dropdown-menu > .active > a > [class*=" icon-"], -.dropdown-submenu:hover > a > [class^="icon-"], -.dropdown-submenu:hover > a > [class*=" icon-"] { - background-image: none; +/* + Other Bootstrap sprites.less reset styles. +*/ +@if $font-awesome-using-bootstrap { + .icon-white, + .nav-pills > .active > a > [class^="icon-"], + .nav-pills > .active > a > [class*=" icon-"], + .nav-list > .active > a > [class^="icon-"], + .nav-list > .active > a > [class*=" icon-"], + .navbar-inverse .nav > .active > a > [class^="icon-"], + .navbar-inverse .nav > .active > a > [class*=" icon-"], + .dropdown-menu > li > a:hover > [class^="icon-"], + .dropdown-menu > li > a:hover > [class*=" icon-"], + .dropdown-menu > .active > a > [class^="icon-"], + .dropdown-menu > .active > a > [class*=" icon-"], + .dropdown-submenu:hover > a > [class^="icon-"], + .dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: none; + } } + [class^="icon-"]:before, [class*=" icon-"]:before { text-decoration: inherit;