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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

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

Packages

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.

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

              
                
              
            
!

CSS

              
                // BOX SIZING
@mixin box-sizing($box-model) {
    -webkit-box-sizing: $box-model; // Safari <= 5
    -moz-box-sizing: $box-model; // Firefox <= 19
    box-sizing: $box-model;
}

// REM FONT SIZE

@function calculate-rem($size) {
    $rem-size: $size / 16px;
    @return $rem-size * 1rem;
}

@mixin font-size($size) {
    font-size: $size;
    font-size: calculate-rem($size);
}

// PLACEHODERS

@mixin placeholder {
    &.placeholder { @content; }
    &::-moz-placeholder { @content; }
    &::-webkit-input-placeholder { @content; }
    &:-ms-input-placeholder { @content; }
}

// OPACITY

@mixin opacity($opacity) {
    opacity: $opacity;
    $opacity-ie: $opacity * 100;
    filter: alpha(opacity=$opacity-ie); //IE8
}

// TRANSFORM

@mixin transform($transforms) {
    -webkit-transform: $transforms;
    -moz-transform: $transforms;
    -ms-transform: $transforms;
    transform: $transforms;
}

// ROTATE

@mixin rotate($deg) {
    @include transform(rotate(#{$deg}deg));
}

// SCALE

@mixin scale($scale) {
    @include transform(scale($scale));
}

// TRANSLATE

@mixin translate($x, $y) {
    @include transform(translate($x, $y));
}

// SKEW

@mixin skew($x, $y) {
    @include transform(skew(#{$x}deg, #{$y}deg));
}

// TRANSFORM ORIGIN
@mixin transform-origin($origin) {
    -webkit-transform-origin: $origin;
    -moz-transform-origin: $origin;
    -ms-transform-origin: $origin;
    transform-origin: $origin;
}

// MULTIPLE BORDER RADIUS

@mixin border-radiuses($top-right: 0, $bottom-right: 0, $bottom-left: 0, $top-left: 0) {
    -webkit-border-top-right-radius: $top-right;
    -webkit-border-bottom-right-radius: $bottom-right;
    -webkit-border-bottom-left-radius: $bottom-left;
    -webkit-border-top-left-radius: $top-left;

    -moz-border-radius-topright: $top-right;
    -moz-border-radius-bottomright: $bottom-right;
    -moz-border-radius-bottomleft: $bottom-left;
    -moz-border-radius-topleft: $top-left;

    border-top-right-radius: $top-right;
    border-bottom-right-radius: $bottom-right;
    border-bottom-left-radius: $bottom-left;
    border-top-left-radius: $top-left;
}

// TRANSITION

@mixin transition($args...) {
    -webkit-transition: $args;
    -moz-transition: $args;
    -ms-transition: $args;
    -o-transition: $args;
    transition: $args;
}

// KEYFRAMES AND ANIMATION

@mixin keyframes($animation-name) {
    @-webkit-keyframes #{$animation-name} { @content; }
    @-moz-keyframes #{$animation-name} { @content; }
    @-ms-keyframes #{$animation-name} { @content; }
    @-o-keyframes #{$animation-name} { @content; }
    @keyframes #{$animation-name} { @content; }
}

@mixin animation($str) {
    -webkit-animation: #{$str};
    -moz-animation: #{$str};
    -ms-animation: #{$str};
    -o-animation: #{$str};
    animation: #{$str};
}

// TRUNCATING TEXT

@mixin truncate($truncation-width) {
    max-width: $truncation-width;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

// APPEARANCE

@mixin appearance($value) {
    appearance: $value;
    -webkit-appearance: $value;
    -moz-appearance: $value;
}

// REPAINT FIX

@mixin repaint-fix {
    @include transform(translate3d(0, 0, 0));
}

// CLEARFIX

@mixin clearfix {
    display: block;

    &::after {
        content: '';
        clear: both;
        display: block;
        height: 0;
        font-size: 0;
        visibility: hidden;
    }
}

// Gradient mixins
// --------------------------------------------------

// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
@mixin gradient($start-color, $end-color, $start, $end) {
    background-image: -webkit-linear-gradient(left, $start-color $start, $end-color $end); // Safari 5.1-6, Chrome 10+
    background-image: -o-linear-gradient(left, $start-color $start, $end-color $end); // Opera 12
    background-image: linear-gradient(to right, $start-color $start, $end-color $end); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
}

@mixin vertical-gradient($start-color, $end-color, $start, $end) {
    background-image: -webkit-linear-gradient(top, $start-color $start, $end-color $end); // Safari 5.1-6, Chrome 10+
    background-image: -o-linear-gradient(top, $start-color $start, $end-color $end); // Opera 12
    background-image: linear-gradient(to bottom, $start-color $start, $end-color $end); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
    background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
}

// TRANSPARENT GRADIENTS (IE 10 up only)

@mixin gradient-alpha($start-color, $end-color, $start, $end) {
    background-image: -webkit-linear-gradient(left, $start-color $start, $end-color $end); // Safari 5.1-6, Chrome 10+
    background-image: -o-linear-gradient(left, $start-color $start, $end-color $end); // Opera 12
    background-image: linear-gradient(to right, $start-color $start, $end-color $end); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
    background-repeat: repeat-x;
}

@mixin vertical-gradient-alpha($start-color, $end-color, $start, $end) {
    background-image: -webkit-linear-gradient(top, $start-color $start, $end-color $end); // Safari 5.1-6, Chrome 10+
    background-image: -o-linear-gradient(top, $start-color $start, $end-color $end); // Opera 12
    background-image: linear-gradient(to bottom, $start-color $start, $end-color $end); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
    background-repeat: repeat-x;
}


              
            
!

JS

              
                
              
            
!
999px

Console