o_O
o_O

Reputation: 5737

Adding CSS to this and a child in LESS?

Targeting children in LESS is easy such as:

header {
    a { color: white; }
}

But what I'm asking is how to assign color: white; to both the parent and the child? I can do:

header {
    color: white;
    a { color: white; }
}

But that is adding the same thing twice and I'm sure there's a better way in LESS.

Upvotes: 1

Views: 30

Answers (1)

seven-phases-max
seven-phases-max

Reputation: 11820

If you really want nesting there, then:

header {
    &, a {color: white}
}

For more details see Parent Selectors.

Upvotes: 3

Related Questions