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

Sass docs recommends @use over @import without clarifying node-sass does not support @use #480

Closed
wu-lee opened this issue Oct 3, 2020 · 3 comments · Fixed by #481
Closed

Comments

@wu-lee
Copy link

wu-lee commented Oct 3, 2020

The Sass docs say here:

The Sass team discourages the continued use of the @import rule. Sass will gradually phase it out over the next few years, and eventually remove it from the language entirely. Prefer the @use rule instead.

However, I cannot get @use to work. I now know the reason, which is that node-sass does not support it. However, there are no errors raised at the point of the @use declaration. Instead they suggest an error later in the source where I attempt to utilise the imported symbols:

Invalid CSS after "...nd-color: color": expected expression (e.g. 1px, bold), was ".adjust($primary-co"

Only after an intensive search did I find out the real cause, from posts such as this one, which also illustrates the case in point:

https://stackoverflow.com/questions/60920833/gatsby-fails-after-using-sass-files-with-use-sasscolor

To help future users avoid an unnecessary hunt, at least until node-sass is no-longer the default in ecosystems like Gatsby, please could the documentation state clearly that node-sass does not support @use, next to the advice to prefer @use to over @import

@nex3
Copy link
Contributor

nex3 commented Oct 5, 2020

At the very top of the @use documentation is a compatibility header that describes exactly which implementation support it, as well as a drop-down that provides more details:

image

@nex3 nex3 closed this as completed Oct 5, 2020
@wu-lee
Copy link
Author

wu-lee commented Oct 6, 2020

I don't deny this. I humbly suggest that something more along the lines of the very noticeable warnings like this (image below) are warrented. Especially so, because the error messages from libsass are misleading:

Screenshot_20201006_103029

Possibly this seems a small thing to you, but for others it could save a lot of time.

@Awjin
Copy link
Contributor

Awjin commented Oct 6, 2020

@wu-lee This was fixed in #481

Friendly-users added a commit to Friendly-users/sass-site that referenced this issue Jun 27, 2024
-----
It is inappropriate to include political and offensive content in public code repositories.

Public code repositories should be neutral spaces for collaboration and community, free from personal or political views that could alienate or discriminate against others. Political content, especially that which targets or disparages minority groups, can be harmful and divisive. It can make people feel unwelcome and unsafe, and it can create a hostile work environment.

Please refrain from adding such content to public code repositories.
---

 sass#400 sass#401 sass#402 sass#403 sass#404 sass#405 sass#406 sass#407 sass#408 sass#409 sass#410 sass#411 sass#412 sass#413 sass#414 sass#415 sass#416 sass#417 sass#418 sass#419 sass#420 sass#421 sass#422 sass#423 sass#424 sass#425 sass#426 sass#427 sass#428 sass#429 sass#430 sass#431 sass#432 sass#433 sass#434 sass#435 sass#436 sass#437 sass#438 sass#439 sass#440 sass#441 sass#442 sass#443 sass#444 sass#445 sass#446 sass#447 sass#448 sass#449 sass#450 sass#451 sass#452 sass#453 sass#454 sass#455 sass#456 sass#457 sass#458 sass#459 sass#460 sass#461 sass#462 sass#463 sass#464 sass#465 sass#466 sass#467 sass#468 sass#469 sass#470 sass#471 sass#472 sass#473 sass#474 sass#475 sass#476 sass#477 sass#478 sass#479 sass#480 sass#481 sass#482 sass#483 sass#484 sass#485 sass#486 sass#487 sass#488 sass#489 sass#490 sass#491 sass#492 sass#493 sass#494 sass#495 sass#496 sass#497 sass#498 sass#498 sass#499
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants