I need to define same style for elements under a media query and descendant by another class.
Perfect solution in LESS could be the following [pseudo-code]:
.foo
{
color:red;
.example &,
@media (min-width:800px)
{
color:blue;
}
}
that should be desirable that would be compiled into:
.foo {
color: red;
}
.example .foo {
color: blue;
}
@media (min-width: 800px) {
.foo {
color: blue;
}
}
THIS SYNTAX IS INCORRECT but, do you have some suggestion to solve my problem?
Thanks to @seven-phases-max suggestion, I finally found a possible solution using Detached Ruleset:
This solution go beyond and offer other options:
MIN/MAX
value of property used in media query (Try to pass "max
" instead of "min
" calling .MEDIAQUERY mixin)@only-media
boolean.