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

@import (reference) copies import directives #2464

Closed
chharvey opened this issue Feb 22, 2015 · 0 comments · Fixed by #2470
Closed

@import (reference) copies import directives #2464

chharvey opened this issue Feb 22, 2015 · 0 comments · Fixed by #2470
Labels

Comments

@chharvey
Copy link
Contributor

When File A uses @import (reference) on File B, and File B itself has its own @import (css) directive, say for normalize.css, this directive gets copied into File A.

This is bad if I'm trying to chain imports and use @import (reference) in combo with @import (css). Example:

// site.less
@import (css) url('normalize.css');
// some other mixins and classes here

/* output site.css */
@import url('normalize.css'); /* as expected */

// page.less
@import (css) url('site.css');        // page.css needs styles from site.css but don't want them injected inline
@import (reference) url('site.less'); // now page.less can use the mixins defined in site.less

/* output page.css */
@import url('site.css');      /* as expected, and site.css already has `@import url ('normalize.css')` thus the "chaining" */
@import url('normalize.css'); /* not expected! probably because of the (reference) keyword */

Now I have two imports of normalize.css, and this gets complicated if page.less and site.less are in different directories.

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

Successfully merging a pull request may close this issue.

2 participants