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

Refactor CSS/SASS/LESS imports #12

Closed
leebenson opened this issue Apr 19, 2017 · 4 comments
Closed

Refactor CSS/SASS/LESS imports #12

leebenson opened this issue Apr 19, 2017 · 4 comments
Assignees
Labels

Comments

@leebenson
Copy link
Member

There are currently differences in the way CSS, LESS and SASS @import statements resolve, causing unexpected behaviour when using ~ to represent node_modules, and relative path names that don't follow the expected Webpack setting.

Needs proper testing.

@bartekus
Copy link
Contributor

Nice work on the refactor @leebenson, I've tested this by successfully integrating Grommet on #18
Adding @import '~grommet/scss/vanilla/index'; to the styles.scss works exactly as expected!
Thank you!

@Extra-lightwill
Copy link

Have you had time to make any progress re: leebenson/reactql#30 ?

If so, what would be the recommended way to import sass partials?

@leebenson
Copy link
Member Author

@Extra-lightwill - sure have, please see #13

TL;DR - Put 'global' @import statements inside a style.global.css file and import that instead. It turns out that :global should only be used for 'inline' statements. See this comment for a more thorough explanation.

@leebenson
Copy link
Member Author

leebenson commented Apr 27, 2017

@Extra-lightwill - as for a recommend way to import SASS partials, this should work just like any other SASS import. e.g.:

// if you're importing locally, from your own source
@import 'src/path/to/partial';

// if you're importing from a `node_modules` npm
@import '~module/path/to/partial'

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

No branches or pull requests

3 participants