Skip to content

Using index stylesheets in scss with the new @use and @forward rules is broken #703

@bdlowery

Description

@bdlowery

I am using dart-sass, and i'm on version 3.21 Build 34472. @use and @forward are not working with mixins and variables.

This is my folder structure:

styles/
├─ settings/
│  ├─ _colors.scss
│  ├─ _index.scss
│  ├─ _typography.scss
site.scss

I have my color variables in _colors.scss, like $coooler: #ffffff.
in typography I have mixins like:

@mixin calm-voice() {
	font-family: sans-serif;
	font-size: 1rem;
	line-height: 1.4;
}

then in _index.scss I have

@forward 'colors';
@forward 'typography';

From my understanding, this is the correct way to setup index files in sass.

Then I try and use this mixin and variable in site.scss like so:

@use 'settings' as *;

body {
	color: $coooler;
	@include calm-voice;
}

Codekit throws out this error, which makes no sense because the variable is defined -

Dart Sass failed with this error: Undefined variable.
   ╷
49 │     color: $coooler;
   │            ^^^^^^^^
   ╵
  site.scss 49:9  root stylesheet

Has anyone gotten the @use and @forward rules to work in codekit with index scss files?

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