Skip to content

Build will fail if some of scss files with variables have @use #237

Description

@nfxpnk

STR:
Add @use 'sass:color'; to _colors.scss and try to build styleguide

Result:

Warn: Atlas: Could not compile configuration file. Styleguide page and consistency checks could not be prepared.
Ensure that "scssAdditionalImportsArray" has all additional imports paths.
 Error: @use rules must be written before any other rules.
   ╷
71 │ @use 'sass:color';
   │ ^^^^^^^^^^^^^^^^^
   ╵
  stdin 71:1  root stylesheet

file models\projectconstants.js combined scss for mustache has an error

function compileStyles(constantsData, additionalSassImports) {
    const template = '{{>constantsFile}} {{#constants}} {{constNameSafe}} { color: {{constName}} } {{/constants}}';
    let cssString = '';

    try {
        const styles = sass.renderSync({
            data: mustache.render(
                template,
                {constants: constantsData.rawConstants},
                {constantsFile: constantsData.fileString}),
            includePaths: additionalSassImports
        });
        cssString = styles.css.toString();
    } catch (error) {
        console.log('Warn: Atlas: Could not compile configuration file. ' +
            'Styleguide page and consistency checks could not be prepared.\n' +
            'Ensure that "scssAdditionalImportsArray" has all additional imports paths.\n', error.formatted);
    }

    return cssString;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions