Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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.

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.

HTML

              
                <div class="oddbirds">
  <input type="radio" name="toggle" id="mia-toggle" checked/>
  <input type="radio" name="toggle" id="carl-toggle" />
  <input type="radio" name="toggle" id="jonny-toggle" />
  
  <div class="tabs">
    <label for="mia-toggle">Mia</label>
    <label for="carl-toggle">Carl</label>
    <label for="jonny-toggle">Jonny</label>
  </div>
  
  <div class="content">
    <div class="eric-content">
      Responsive CSS Tabs in Sass, 
      with help from the float isolation method.
      <ul>
        <li>Container wraps all tabs dynamically</li>
        <li>Container remains equal-height</li>
        <li>No JS Height calculations</li>
        <li>The entire thing is responsive</li>
      </ul>  
    </div>
    <div class="carl-content">
      Carl is a coder, Pythonista, & Django developer.
    </div>
    <div class="jonny-content">
      Jonny is a front-end developer & philosophy professor.
      <ul>
        <li>Lorem ipsum dolor sit amet.</li>
        <li>Aliquam tincidunt mauris eu risus.</li>
        <li>Vestibulum auctor dapibus neque.</li>
        <li>Lorem ipsum dolor sit amet.</li>
        <li>Aliquam tincidunt mauris eu risus.</li>
        <li>Vestibulum auctor dapibus neque.</li>
      </ul>  
    </div>
  </div>
</div>
              
            
!

CSS

              
                @import "compass/css3";

@import "compass";

/* Tab Settings */
$default-checked-selector : ':checked';
$default-nested-selectors : null;

$toggle-attribute   : id;
$title-attribute    : for;
$content-attribute  : class;

/* Tab Toggle Defaults */
%gone {
  position: absolute;
  visibility: hidden;
}
%hide-tab-toggle { @extend %gone; }

/* Tab Content Defaults */
%hide-tab-content {
  @include transition(opacity 300ms);
  opacity: 0; /* Hide */
  float: left; /* Isolation */
  width: 100%; /* Isolation */
  margin-right: -100%; /* Isolation */
}
%show-tab-content {
  opacity: 1; /* Show */
  position: relative; /* Bring to top */
  z-index: 10; /* Bring to top */
}
%active-tab-title {
  background: none;
  border-bottom-color: rgba(black, 0);
}

/* Tabs Mixin */
@mixin tabs(
  $slugs,
  $nested: $default-nested-selectors,
  $checked: $default-checked-selector
) {
  $nested-tabs: $nested;
  $nested-content: $nested;
  @if length($nested) > 1 {
    $nested-tabs: nth($nested, 1);
    $nested-content: nth($nested, 2);
  }

  @each $slug in $slugs {
    $toggle   : '[#{$toggle-attribute}*="#{$slug}"]';
    $title    : '[#{$title-attribute}*="#{$slug}"]';
    $content  : '[#{$content-attribute}*="#{$slug}"]';

    #{$content} { @extend %hide-tab-content; }
    #{$toggle} {
      @extend %hide-tab-toggle;
      &#{$checked} {
        & ~ #{$nested-tabs} #{$title} {
          @extend %active-tab-title !optional;
        }
        & ~ #{$nested-content} #{$content} {
          @extend %show-tab-content;
        }
      }
    }
  }
}

/* Creating Tabs */
.oddbirds {
  @include tabs(mia carl jonny, ".tabs" ".content");
}

/* Paint Job */
* { @include box-sizing(border-box); }

body { 
  @include adjust-leading-to(1.1);
  padding: rhythm(1);
  background: #437691;
}

.oddbirds {
  @include box-shadow(rgba(black,.5) 0 0 .5em);
  width: 80%;
  max-width: 40em;
  margin: 0 auto;
  background: lightblue;
}

[for] {
  @include rhythm-borders(1px,.25);
  float: left;
  width: percentage(1/3);
  text-align: center;
  background: #7ac;
  ~ [for] { border-left: 0 }
  &:last-child { float: right; }
}

.content {
  @include clearfix;
  @include rhythm-borders(1px,.5);
  clear: both;
  border-top: 0;
  ul { 
    list-style: disc; 
    padding-left: rhythm(1);
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console