Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="page-wrap">
  <section class="main-content">
    <h1>Converting Ben Smithett's Sass Flexbox Mixin to SCSS</h1>
    <p><strong>I'm first in the source order.</strong></p>
    <p>Ben's original Sass based Mixin can be found at <a href="https://codepen.io/bensmithett/pen/neuyI">https://codepen.io/bensmithett/pen/neuyI</a>. I've updated his to be in the SCSS flavor of Sass. If you dig it, <a href="https://twitter.com/adamj_design">follow me on Twitter</a> for more cool sassy stuff.</p>
    <p> This whole deal stemmed from <a href="https://css-tricks.com/using-flexbox/">Chris Coyier's Flexbox article</a>.</p>
  <nav class="main-nav">
      <li><a href="#">Home</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Clients</a></li>
      <li><a href="#">Contact Us</a></li>
  <aside class="main-sidebar">
    <p>I am a rather effortless column of equal height.</p>
              @import "compass/css3";

/* Mixins */
@mixin flexbox-display-flex {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
@mixin flexbox-flex($width) {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  width: $width; // Passing our width value here
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
@mixin flexbox-order($order) {
  -webkit-box-ordinal-group: $order;
  -moz-box-ordinal-group: $order;
  -ms-flex-order: $order;
  -webkit-order: $order;
  order: $order;
/* Example */
.page-wrap {
  @include flexbox-display-flex;
.main-content {
  @include flexbox-order(2);
  width: 60%;
  -moz-box-flex: 1;
  background: white;
.main-nav {
  @include flexbox-order(1);
  @include flexbox-flex(20%);
  background: #ccc;
.main-sidebar {
  @include flexbox-order(3);
  @include flexbox-flex(20%);
  background: #ccc;
/* Extra styling stuff, you can safely delete everything below this line for your projects */
.main-nav {
  padding: 1em;
body {
  padding: 2em;
  background: #79a693;
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
h1, h2 {
  font: bold 2em Sans-Serif;
  margin: 0 0 1em 0;
h2 {
  font-size: 1.5em;
p {
  margin: 0 0 1em 0;
Browser support

Chrome any
Firefox any
Safari any
Opera 12.1+
IE 10+

iOS any
Android any
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.