Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think what Compass has to offer in order to allow us to create cleaner and <strong>semantic markup</strong> comes for free if you already use SASS alone.</p> <p>By instance take this trivial example:</p> <h3>Some Mixins</h3> <pre><code>@mixin box { display: block; } @mixin sized_box($width:auto, $height:auto) { @include box; width: $width; height: $height; } @mixin floated_box($direction:none, $width:auto, $height:auto) { @include sized_box($width, $height); float: $direction; } @mixin left_box($width:auto, $height:auto) { @include floated_box(left, $width, $height); } @mixin right_box($width:auto, $height:auto) { @include floated_box(right, $width, $height); } </code></pre> <h3>A Placeholder</h3> <pre><code>// divs will be red div%colored_floating { @include left_box; background-color: #ff0000; } // paragraphs will be blue p%colored_floating { @include right_box; background-color: #0000ff; } </code></pre> <h3>Our stylesheet</h3> <pre><code>// if #some.selector * turns out to be a div it will be red, // and if it is a paragraph it will be blue #some.selector *{ @extend %colored_floating; } </code></pre> <h3>Finally on your markup, you don't need any presentational classes</h3> <p>Except for those to make the placeholders more specific, of course.</p> <pre><code> &lt;section id="some" class="selector"&gt; &lt;div&gt;This will float and it will be red&lt;/div&gt; &lt;p&gt;But this will float right and will be blue&lt;/p&gt; &lt;/section&gt; </code></pre> <p>You could always do:</p> <pre><code>// to make the placeholders absolutely generic to the whole markup, * { @extend %colored_floating; } </code></pre> <p>Again, sorry for the very trivial example, but hopefully it will give you an idea on how to get rid of the presentational classes on your markup, aiming to pure semantic content.</p> <p>What Compass gives us in addition is a complete framework of these mixins, placeholders and so on, ready to be used for good.</p> <p>Cheers!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload