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

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

Open
nfxpnk opened this issue Jan 15, 2023 · 0 comments
Open

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

nfxpnk opened this issue Jan 15, 2023 · 0 comments

Comments

@nfxpnk
Copy link

nfxpnk commented Jan 15, 2023

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;
}
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

1 participant