I was wondering if I could override the nesting in LESS, to stay in my scope - just because it's simpler... :-)
If I have an element which has two states, depending on let's say a body
-class, I need to define two CSS objects. I would like to have only one, per module.
.module {
h1 {
float: left;
}
}
body.secondary {
.module {
h1 {
float: right;
}
}
}
Like when you define the parent with &
, is there any way to overwrite that parent?? So maybe it could look like this:
.module {
h1 {
float: left;
}
&=body.secondary {
h1 {
float: right;
}
}
}
Where the &
is defined as another selector...
This could be awesome, and make my CSS more simple in terms of one CSS object per module.
Thanks... :-)