Skip to content

SASS @at-root generated class names do not work with plugin #81

Open
@ncrum

Description

@ncrum

When using SASS @at-root directive and referencing the parent class name with #{&}, the babel plugin is unable to find a class, but the class exists at runtime. Below is the error I'm getting, here is the basic setup:

.ResultWrapperHeader {
  ...
  @at-root #{&}__title {
    ...
  }
}

Which outputs to:

.ResultWrapperHeader {...}
.ResultWrapperHeader__title {...}

The plugin gives me this error message: Could not resolve the styleName 'ResultWrapperHeader__title'.

This may just be something that is not supported with the babel plugin version, since the plugin would have to process the sass to css in order to know what the class name is. Is there a way around this issue and still use this nested pattern (other than not using nesting)?

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