Skip to content

Problems mixing-in rulesets defined using & combinator #1270

Closed
@tcjr

Description

@tcjr

When I use the & combinator to define a ruleset like this:

.label {
  &-success {
    background-color: blue;
   }
}

This correctly creates css like this:

.label-success {
  background-color: blue;
}

However, when I try to add/mixin the label-success ruleset into another, like this:

.mySuccessLabel {
  .label-success;
}

It fails compilation with: "Name error: .label-success is undefined"

Here is the complete example showing the error:

.label {
  &-success {
    background-color: blue;
   }
}

.mySuccessLabel {
  .label-success;
}

I am using twitter bootstrap. They define labels and badges like above. https://github.com/twitter/bootstrap/blob/master/less/labels-badges.less#L52

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions