title: PHP : Is there a way to load only CSS classes I need?
body: <p>I'm using PHP and each page of my website can return its own HTML elements in an array as the one below (right before being rendered). So I can get the complete list of HTML tags, classes and attributes that my page contains right before loading my CSS.</p>
  <p>In a perfect world, I'm free to use &quot;Bootstrap like&quot; classes as &quot;mx-lg-8&quot;, but &quot;mx-lg-7&quot; is not loaded if I don't need it.</p>
  <p>I'm a dreaming ? :)
  What would you do to optimize your CSS request ?</p>
  <p>Thanks for your advice !</p>
  <pre><code>$HTML_elements = array(
      array( 
          'tag' =&gt; 'body',
          'atts' =&gt; array(
              'class' =&gt; array( 'mx-lg-8', 'bg-dark', 'text-red' ),
              'data-attribute' =&gt; 'attribute-value'
          ),
      ),
      array( 
          'tag' =&gt; 'header',
          'atts' =&gt; array(
              'class' =&gt; array( 'class-1', 'class-2', 'class-3' ),
          ),
      ),
      array( 
          'tag' =&gt; 'div',
          'atts' =&gt; array(
              'class' =&gt; array( 'class-1', 'class-2', 'class-3' ),
          ),
      ),
      #...
  );
  </code></pre>