Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <article class="content">

<header class="header-block typography">
  <h1>How Sass can shape the future of&nbsp;CSS</h1>

  <p>The rise in popularity of CSS extensions, such as Sass, in recent years has not gone unnoticed by the people who work on proposing and standardizing modules for CSS3 (and CSS4).</p>

<div class="typography">
  <h2>Sass features being adapted for submission</h2>
  <p>Many of the key features found in Sass are being adapted for submission to the W3C. <a href="">Variables, Mixins, and Nesting are all mooted for inclusion in CSS</a>, and we may see some of them appear in the near future.</p>

  <p>Then again, we may not; resistance to the proposals is quite strong from certain members - for example, <a href="">Bert Bos</a> wrote a long article on <a href="">why he considers CSS Variables to be harmful</a>. But I thought it would be interesting for the Sass community to see how the software to which you develop and contribute to (Sass) is being used to discuss the future of the web.</p>

  <h2>The Variables proposal</h2>
  <p>This proposal should look very familiar to you - it’s the same syntax that Sass uses, with one addition. Each variable is defined using a three-part syntax: first you set up the declaration using the <code>@var</code> at-rule, then you provide a unique name with the <code>$</code> character before it, then you set the value:</p>

  <pre>@var $foo #F00;</pre>

  <p>Once set up like this, you can reference your variable by using the unique name as a value:</p>

  <pre>h1 {
  color: $foo;

  <p><a href="">This proposal has already been put forward to the W3C</a>, and I’ll tell you the result of that shortly.</p>

  <h2>The Mixins proposal</h2>
  <p>As with Variables, you should be very familiar with the Mixins proposal - the syntax used in Sass was the inspiration. You create a declaration block using the @mixin at-rule, assign a unique id, and then add your rules:</p>

  <pre>@mixin foo {
  color: #F00;
  font-weight: bold;

  <p>When you need to use that code block you call it using the @mix directive and the unique id you previously assigned:</p>

  <pre>h1 {
  font-size: 2em;
  @mix foo;

  <p>As you can see, the only difference is that the CSS proposal uses @mix in place of Sass’s @include. As with Sass, you can also use parameters with Mixins:</p>

<pre>@mixin foo($bar #F00) {
  border-color: $bar;
  color: $bar;

h1 {
  @mix foo(#00F);

  <h2>An alternative variables syntax</h2>

  <p>Recently, <a href="">an alternative syntax for Variables has been proposed</a>. This syntax looks and acts somewhat similarly to the HTML data attribute, although it’s not the same. In this proposal variables are scoped to elements (for global scope, you’d use the :root selector) and the variable name is prefixed with data-:</p>

<pre>:root {
  data-foo: #F00;

  <p>Then you reference the variable by using the unique name in the data function:</p>

<pre>h1 {
  color: data(foo);

  <p>This has the advantage of allowing scoped variables, and integrating better with the <a href="">CSSOM</a>, JavaScript, as well as inspector tools like <a href="">Firebug</a> or <a href="">Dragonfly</a>.</p>

  <p>It must be stressed, however, that this is still only at the discussion stage.</p>

  <h2>So when will we see them?</h2>
  <p>As I said, maybe never. As I understand it, the first Variables proposal was not well received by the W3C - but the module author, <a href="!/tabatkins">Tab Atkins</a>, is continuing to refine it anyway. Tab is also key to the creation of the alternative syntax. You can follow along with Tab and his writing at his personal blog where he shares his thoughts on web standards as well as details surrounding discussions on the future of CSS.</p>

  <p>As for Mixins, they were rejected out of hand and probably won’t be pursued. The reason given? Lack of use cases. But I can’t imagine that you, as Sass creators, developers and users are short of use cases for Mixins. So, if you have them I’d love to read them - please leave a comment below sharing your thoughts if that’s the case.</p>

  <p>If work does continue on these proposals, or any part of them, I think that it would be a matter of little time before browsers started to implement them; I believe, in fact, that <a href="">WebKit</a> already implemented Variables, only to remove them after feedback from the <a href="">W3C</a>.</p>

  <p>I have to confess that I’ve only briefly experimented with Sass, and have not used it in any production websites, but what I like about it is the ease with which it’s been possible to adapt the syntax into CSS itself. It’s great to see community-created language extensions influence the evolution of the web, and even if none of these proposals ever make it to the implementation stage, you can be sure that <b>at the very least</b> they form part of the standards conversation.</p>

    <li><a href="" class="link external" target="_blank">CSSOM, Vars, Mixins, Nesting, and Modules</a></li>
    <li><a href="" class="link external" target="_blank">Why “variables” in CSS are harmful</a></li>
    <li><a href="" class="link external" target="_blank">CSS Variables Draft</a></li>
    <li><a href="" class="link external" target="_blank">Better Variables through Custom Properties from Tab Atkins Jr. on 2011-10-24</a></li>

<footer class="author-block typography">
  <h2>The Author, Peter Gasston</h2>

  <p><img class="float-left" src="" width="120" height="120" alt="Peter Gasston"> <a href="">Peter Gasston</a> works as a developer at <a href="">Top10</a> and codes mainly client-side languages (although he’s familiar with server-side as well). Peter is a keen advocate of open web standards, is the author of <a href=""><i>The Book of CSS3: A Developer’s Guide to the Future of Web Design</i></a> (released May 2011), and has written for .Net magazine and <a href=""></a>.</p>

    <p>Peter blogs on technical issues at <a href=""></a>, has spoken at <a href="">Ignite London</a> as well as various other web development meetings, and can often be found under the user name of ‘stopsatgreen’ (clever anagram).</p>

    <p>Connect with Peter on Twitter at <a href="!/stopsatgreen">@stopsatgreen</a> and <a href=""></a>.</p>



                @import "compass/css3";

@import 'compass';

@include global-reset;

 * Variables

$text-color: #333;
$quiet-color: #ccc;
$loud-color: #000;
$heading-color: #111;

$link-color: #d54aaf;
$link-hover-color: saturate(#d54aaf, 20%);
$link-visited-color: purple;

$base-font-family: 'Roboto Condensed', sans-serif;
$base-font-size: 18px;
$base-font-weight: 300;

$fixed-font-family: 'Andale Mono', AndaleMono, monospace;
$fixed-font-size: 15px;
$fixed-line-height: 1.2;

$heading-font-family: 'Roboto Condensed', sans-serif;
$heading-font-weight: 700;

 * Base styles

body {
  color: $text-color;
  font-size: $base-font-size;
  font-family: $base-font-family;
  font-weight: $base-font-weight;
  padding: 30px;
  line-height: 1.6;

 * Typography

.link {
  color: $link-color;
  text-decoration: none;
  &:visited {
    color: $link-visited-color;
  &:hover, &:visited:hover {
    color: $link-hover-color;
    text-decoration: underline;

.fixed { font-family: $fixed-font-family; font-size: $fixed-font-size; line-height: $fixed-line-height; }

.quiet { font-color: $quiet-color; }
.loud  { font-color: $loud-color; }

.italic { font-style: italic; }
.bold   { font-weight: 700; @extend .loud; }

.h1, .h2, .h3, .h4, .h5, .h6 { font-family: $heading-font-family; font-weight: $heading-font-weight; }
.h1, .h2 { line-height: 1.1; }
.h3, .h4 { line-height: 1.3; }
.h1 { font-size: 400%; letter-spacing: -2px; }
.h2 { font-size: 250%; letter-spacing: -1px; }
.h3 { font-size: 200%; }
.h4 { font-size: 180%; }
.h5 { font-size: 130%; }
.h6 { font-size: 100%; }

.block-margins { margin: 1em 0; }

.unordered-list { list-style-type: disc; }
.ordered-list { list-style: decimal; }

.typography {
  a { @extend .link; }

  i, em { @extend .italic; }
  b, strong { @extend .bold; }
  h1 { @extend .h1; margin: 1em 0 0.5em; }
  h2 { @extend .h2; margin: 1em 0 0.5em; }
  h3 { @extend .h3; margin: 1em 0 0.5em; }
  h4 { @extend .h4; margin: 1em 0 0.5em; }
  h5 { @extend .h5; margin: 1em 0 0.5em; }
  h6 { @extend .h6; margin: 1em 0 0.5em; }
  p, ul, ol, pre { @extend .block-margins; }
  ul { @extend .unordered-list; }
  ol { @extend .ordered-list; }
  pre, code { @extend .fixed; }

 * Modifiers

.float-left  { float: left; margin-right: 1em; }
.float-right { float: right; margin-left: 1em; }

.text-left   { text-align: left   !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right  !important; }

 * Object definitions

.content {
  margin: 0 auto;
  width: 32em;

.header-block {
  font-size: 110%;
  &.typography h1 { font-size: 450%; margin-top: 0 !important; }

.author-block {
  border-top: 3px double $quiet-color;
  margin-top: 4em;