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

Support @use of vendor styles in scss #39

Open
MaximBalaganskiy opened this issue Jul 22, 2020 · 8 comments
Open

Support @use of vendor styles in scss #39

MaximBalaganskiy opened this issue Jul 22, 2020 · 8 comments

Comments

@MaximBalaganskiy
Copy link

Required, for example, for Google Material Design.
Example gist

@3cp
Copy link
Member

3cp commented Jul 23, 2020

3cp added a commit that referenced this issue Jul 24, 2020
@3cp
Copy link
Member

3cp commented Jul 24, 2020

Running into some weird sass.js behaviour I don't understand.

Also, @use is blocked by medialize/sass.js#127, @import might work if I can fix my current implementation.

Npm module sass.js is currently the only sass implementation can run in browser.

3cp added a commit that referenced this issue Jul 24, 2020
3cp added a commit that referenced this issue Jul 24, 2020
3cp added a commit that referenced this issue Jul 26, 2020
@3cp
Copy link
Member

3cp commented Jul 26, 2020

Published some code. You might need to clean up browser cache.

The @use would not work because it's missing from sass.js npm module. The line is simply ignored.
You can use @import "@material/button/mdc-button"; but sass complains you have a syntax error in @material/button/mdc-button.scss

@include mixins.core-styles;

@MaximBalaganskiy
Copy link
Author

yeah... because google uses @use which is ignored

@3cp
Copy link
Member

3cp commented Jul 26, 2020

That's unfortunate.

@MaximBalaganskiy
Copy link
Author

Would it be possible to replace @use with @import during bundling?

@3cp
Copy link
Member

3cp commented Jul 26, 2020

Definitely possible, but I am not willing to. Because sass @use and @import are semantically different (although I don't know enough details), I don't want to implement wrong hacking.

When I got time, I would have a look into sass.js to see what stopped it from supporting @use.

@3cp
Copy link
Member

3cp commented Jul 26, 2020

I think we can leave this issue open. It's still to be solved from sass.js.

@3cp 3cp reopened this Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants