lowlighter/matcha

Support `.layout-simple` class for arbitrary element

alex-at-dev opened this issue · 1 comments

I'd like to use matcha.css for a React app. Usually React-apps are bootstrapped inside a root HTML element that's not the body, which leads to .layout-simple not working.

The basic HTML structure of a React app usually looks more or less like this:

<html>
  <head>...</head>
  <body>
    <div id="root">
      <!-- React app renders here. -->
    </div>
    <script src="/main.js"></script>
  </body>
</html>

Rendering without a wrapping <div> is strongly discouraged, as third-party libs, extensions or tools may add / change direct children of <body>.

My suggested solution: Changing all body.layout-simple selectors to .layout-simple.

Would this be an option? Or is there a deliberate reason to use body.layout-simple?

Hi !

Yes indeed there's no special reason to enforce it on the body I think.
I'll look into it 👍