Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new directive proposal - @use #320

Closed
gillyb opened this issue Mar 14, 2012 · 12 comments
Closed

new directive proposal - @use #320

gillyb opened this issue Mar 14, 2012 · 12 comments
Labels
enhancement New feature or request

Comments

@gillyb
Copy link

gillyb commented Mar 14, 2012

Using this directive, it will allow me to extend classes from another file, but without importing the whole file contents into my file.

Example :

// common.scss
.bold { font-weight:bold; }
.cool-style { font-size:10px; }
// other.scss
@use "common"
.other-cool-style { @extend .bold; }

This will generate 2 files.

  1. The common.css file - as sass would generate it now
  2. The other.css file which will only have the 'other-cool-style' class with the 'bold' definition in it, but without importing the other styles in the common file.
@chriseppstein
Copy link

Possibly related: #139

I'm not sold on this particular use case because it's so easy to separate out the bits that output from the bits that don't. Especially now that we have placeholder selectors for use with @extend.

@phaza
Copy link

phaza commented Mar 14, 2012

I miss this functionality aswell. I'm using compass-twitter-bootstrap with rails, and it's not easy to separate CSS into different files and extend the ctb-classes as it is now. My workaround is to import ctb and all my custom scss-files into one file. Not optimal, but it woks without duplicating ctb into every file where I extend it.

@nex3
Copy link
Contributor

nex3 commented Mar 14, 2012

This is something we'll want to support in the next version of @import, but not something we'll want to add a new directive for right now.

@gillyb
Copy link
Author

gillyb commented May 6, 2012

Hey, What's the status on this one ? Did you decide to develop it in the end ?

@jarednorman
Copy link

What's the status on this?

@nex3
Copy link
Contributor

nex3 commented Sep 28, 2012

We're planning to add a new @import-style directive that supports this use case, but we have not seriously started planning it yet.

@jarednorman
Copy link

Cool. Thanks!

@JulienCabanes JulienCabanes mentioned this issue Jan 30, 2014
5 tasks
@julzmon
Copy link

julzmon commented Jul 15, 2014

I would appreciate this addition especially when using Bootstrap.

@lolmaus
Copy link

lolmaus commented Jul 15, 2014

@julzmon, just extend placeholder selectors of bootstrap-sass.

@crush83
Copy link

crush83 commented Oct 23, 2015

@lolmaus The problem is when you have @import statements importing the placeholders into your partial file, it ends up duplicating the placeholder output (times how many @imports you have of that particular placeholder).

@chriseppstein
Copy link

Duplicate of #1094

@lolmaus
Copy link

lolmaus commented Oct 27, 2015

@crush83

@lolmaus The problem is when you have @import statements importing the placeholders into your partial file, it ends up duplicating the placeholder output (times how many @imports you have of that particular placeholder).

Ever heard of sass-imort-once?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants