css - How can one import only variables and mixins from Scss stylehsheets? -
i'm using zurb foundation 4 (s)css framework, , i'm running issue of massively duplicated styles. because in every file @import 'foundation'
in, styles foundation imported (rules body
, .row
, .button
, friends). leads long scss compile times, , hard navigate web developer console in chrome, of zurb's styles declared 4 or 5 times.
to mitigate this, i've created globals
scss file, contains overrideable variables foundation uses (it's copy-pasted foundation_and_overrides.scss
, foundation_and_overrides
import globals). importing globals.scss
file gets rid of duplication in files don't make use of foundation mixins.
it's in files make use of foundation mixins: can import mixins scss file, without importing concrete foundation styles?
imports or nothing thing. that's in file get. if through source of foundation, though, there variables can modify suppress emitting styles (eg. in buttons, setting $include-html-button-classes
false disable styles). design pattern foundation specific, cannot expect other libraries authored way.
when import foundation via @import "foundation"
, you're importing file: https://github.com/zurb/foundation/blob/master/scss/foundation.scss. can see, imports other files. don't have import file if don't need everything: import specific file want (eg. @import 'foundation/components/side-nav'
side-nav file).
Comments
Post a Comment