Skip to content

Using the @use rule #313

@Albinutte

Description

@Albinutte
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions