Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Include only specific files #113

Closed
haihappen opened this Issue · 10 comments

5 participants

@haihappen

Is there a way to only include specific files into my stylesheets?

For example:

@import 'bourbon/css3';
@haihappen

Ok, it seems that your implementation of modular-scale is in conflict with @scottkellum's modular-scale which is used by @zurb's foundation 3.0. Thats the reason for following problem:

bokmann/font-awesome-rails#7

@scottkellum

Curious how you are using Burbon + Compass stylesheets in Foundation together. Plenty of great unique features in each but there are bound to be other conflicts.

@haihappen
@haihappen

So there is no way to include only specific files?

@gesquinca

Or is there a way to exclude specific files? i.e. don't import "functions/modular-scale" in Bourbon.

@kerns

To me this whole discussion highlights what I perceive as the downside of using Compass and Bourbon gems. I don't understand the advantage over just exporting or rync'ing from the latest git repo of a library.

This is not to say there are not advantages,...there must be, I'm just not aware of what they are yet.

To meet my own requirements, I really prefer having the actual files in my working directory. When shipping a project to a client, or to other team members by way of git, it's even more important that there exists a canonical version of all files being used to build the site.

To the point, if I don't want or need "functions/modular_scale", I go into sass/_bourbon.scss and remove the include.

@plapier

If you are using only one sass library, like bourbon, removing an import inside _bourbon.scss would not change the final output of your CSS. Because bourbon doesn't output anything unused to your final rendered CSS file, excluding specific mixins would provide no valuable gain.

@plapier

I wonder if we could build functionality where by default, all bourbon files are imported, but by setting a global variable: $bourbon-import-all: false, none of the bourbon files would be imported. Then you could therefore import specific bourbon mixins and function.

EDIT:
What I mentioned above is not feasible: sass/sass#451

@kerns

@plapier True, I guess I was thinking more in terms of reserving conflicts that might arise from patchworked libraries like mine. Or just tailoring, cleaning out what you might perceive as kludge. But, still...good point.

@plapier

@haihappen @gesquinca @kerns: There doesn't appear to be a way to explicitly exclude specific imports, but after playing around with things, I've discovered you can actually include only specific files.

I don't advise going this route.

For rails projects, the Bourbon files are being pulled from the gem, which looks in the gem's ./app/assets/stylesheets/ directory. Usually we load the _bourbon.scss partial from here with @import "bourbon";, but instead you can load specific files like so:

@import "css3/transition";
@import "addons/prefixer"; // Most all mixins require this.

Basically, you can optionally import anything from Bourbon's stylesheets/ directory: https://github.com/thoughtbot/bourbon/tree/master/app/assets/stylesheets

@plapier plapier closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.