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

Using the @use rule #313

Open
1 of 3 tasks
Albinutte opened this issue Oct 28, 2021 · 3 comments
Open
1 of 3 tasks

Using the @use rule #313

Albinutte opened this issue Oct 28, 2021 · 3 comments

Comments

@Albinutte
Copy link

  • Feature request
  • Bug report
  • Question

Hey there! I would like to be able to use the @use rule to load modules in a way that works both for with Meteor and with the storybook in our project. However, I cannot get namespeces to work. If I import module like this:

@use 'constants' as *;
@use 'colors' as *;

, I can use the variables from the imported modules. However, if I try to do something like this:

@use 'colors';

@mixin ellipsis($color: colors.$white, $isVertical: false) {
  ...
}

, compilation fails:

/Users/albina/.meteor/packages/meteor-tool/.2.4.0_1.1kt1kce.bfrc++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/fibers.js:92
                                        return fn.apply(this, arguments);
                                                  ^
{
  message: 'Scss compiler error: Error: Invalid CSS after "...($color: colors": expected expression (e.g. 1px, bold), was ".$white, $isVertica"\n' +
    '        on line 46 of {}/client/css/base/_mixins.scss\n' +
    '>> @mixin ellipsis($color: colors.$white, $isVertical: false) {\n' +
    '\n' +
    '   ------------------------------^\n' +
    '\n',
  info: {
    file: '/imports/client/components/ui/react-table/Table.scss',
    line: undefined,
    column: undefined,
    func: undefined
  }
}

Is the use of @use just not fully supported by libsass? If so, any chance I could find ETA on migration to dart-sass?

meteor version: 2.4

fourseven:scss version: 4.15.0

@uuuJ
Copy link

uuuJ commented Nov 16, 2022

Hey @Albinutte , I'm digging some infos about the @use in fourseven:scss. Everything I found on this topic lead me to the fact that the @use feature can't be used in fourseven:scss as it's not supported by node-sass (which is used by fourseven:scss).

Everything except this issue where you seem to say that you managed to make it work... Did you really ? How ?

@Albinutte
Copy link
Author

Hey @uuuJ, I'm not sure if something changed in the latest versions, but I'm afraid I can no longer use @use at all 😞 Last time I tried it, doing something like @use 'colors' as *; would simply import everything in the file, potentially causing collisions. When I try it now though, Meteor simply fails to start. Sorry!

@nicubarbaros
Copy link

Any updates here?

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

3 participants