Search code examples
htmlcsslesssemantic-markup

LESS/CSS: Is it possible to wrap a class around the outside of another without HTML?


If my HTML looks like this:

<div class="purely-aesthetic-wrapper">
    <section>
        …
    </section>
</div>

…is it possible to omit the outside div from the HTML and do something like this (with LESS):

section {
           enclose-with(.purely-aesthetic-wrapper);
         }

Sorry if it's an obvious question but I'm not having much luck finding the answer.


Solution

  • Short answer is no, it's not possible.

    LESS is css pre-processor and it has nothing to do with HTML/DOM-tree