I want to be able to access classes further up the dom tree from within a nested class using LESS CSS, see example:
HTML:
<html class="svg">
<body>
<div class="content">
<div class="container">
<div class="logo"></div>
</div>
</body>
</html>
LESS:
.container {
.logo {
background:url(/images/ws-logo.gif);
}
}
I want to target the .svg class on the html tag from within the .logo nested rule, to keep things tidy instead of writing another rule like this:
.svg {
.container {
.logo {
background:url(/images/logo.svg);
}
}
}
So, ideally something like this:
.container {
.logo {
background:url(/images/logo.gif);
(some-symbol).svg {
background:url(/images/svg-logo.svg);
}
}
}
I'm using modernizr to detect svg support.
Anyone know if this is possible? Or have any recommendations?