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

              
                <div class="lvl1">8-Bit borders using CSS3 shadows</div><hr/>
<div class="lvl2">4px border, 2 stpes</div><hr/>
<div class="lvl3">3px border, 3 steps</div><hr/>
<div class="lvl4">5px border, 4 steps</div><hr/>
<div class="other">6px border, 1 step</div><hr/>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Press+Start+2P);
body {
  text-align: center;
  margin: 1em;
  font: 1.4em "Press start 2P";
  font-weight: 700;
}
* {
  box-sizing: border-box;
}
div {
  margin: 0 auto;
  display: inline-block;
  text-align: center;
  padding: .4em 1.3em;
}
hr {
  height: 10px;
  visibility: hidden;
}
@mixin step1( $width, $color ) {
  box-shadow: 
    $width 0 $color, 
    -$width 0 $color,
    0 (-$width) $color, 
    0 $width $color;
  margin: $width auto;
}
/*@mixin step2( $width, $color, $bgcolor ) {
  box-shadow:
    $width 0 $bgcolor,
    -$width 0 $bgcolor,
    0 (-$width) $bgcolor,
    0 $width $bgcolor,
    2*$width 0 $color,
    -2*$width 0 $color,
    0 (-2*$width) $color,
    0 2*$width $color,
    $width $width $color,
    -$width $width $color,
    $width (-$width) $color,
    -$width (-$width) $color;
}*/
@mixin step2v2( $width, $color, $bgcolor ) {
  box-shadow:
    $width 0 $bgcolor,
    -$width 0 $bgcolor,
    0 (-$width) $bgcolor,
    0 $width $bgcolor,
    2*$width 0 $color,
    -2*$width 0 $color,
    0 (-2*$width) $color,
    0 2*$width $color, 
    0 0 0 $width $color;
  margin: 2*$width auto;
}
/*@mixin step3( $width, $color, $bgcolor ) {
  box-shadow:
    $width 0 $bgcolor,
    -$width 0 $bgcolor,
    0 (-$width) $bgcolor,
    0 $width $bgcolor,
    2*$width 0 $bgcolor,
    -2*$width 0 $bgcolor,
    0 (-2*$width) $bgcolor,
    0 2*$width $bgcolor, 
    0 0 0 $width $bgcolor,
    3*$width 0 $color,
    -3*$width 0 $color, 
    0 3*$width $color,
    0 (-3*$width) $color, 
    -2*$width (-$width) $color,
    -$width (-2*$width) $color,
    $width (-2*$width) $color,
    2*$width (-$width) $color,
    2*$width $width $color,
    $width 2*$width $color, 
    -$width 2*$width $color,
    -2*$width $width $color;
}*/
@mixin step3v2( $width, $color, $bgcolor ) {
  box-shadow:
    $width 0 $bgcolor,
    -$width 0 $bgcolor,
    0 (-$width) $bgcolor,
    0 $width $bgcolor,
    2*$width 0 $bgcolor,
    -2*$width 0 $bgcolor,
    0 (-2*$width) $bgcolor,
    0 2*$width $bgcolor, 
    0 0 0 $width $bgcolor,
    3*$width 0 $color,
    -3*$width 0 $color, 
    0 3*$width $color,
    0 (-3*$width) $color,
    0 (-$width) 0 $width $color,
    0 $width 0 $width $color,
    $width 0 0 $width $color,
    -$width 0 0 $width $color;
  margin: 3*$width auto;
}
@mixin step4( $width, $color, $bgcolor ) {
  box-shadow:
    $width 0 $bgcolor,
    -$width 0 $bgcolor,
    0 (-$width) $bgcolor,
    0 $width $bgcolor,
    2*$width 0 $bgcolor,
    -2*$width 0 $bgcolor,
    0 (-2*$width) $bgcolor,
    0 2*$width $bgcolor, 
    0 0 0 $width $bgcolor,
    3*$width 0 $bgcolor,
    -3*$width 0 $bgcolor, 
    0 3*$width $bgcolor,
    0 (-3*$width) $bgcolor,
    0 (-$width) 0 $width $bgcolor,
    0 $width 0 $width $bgcolor,
    $width 0 0 $width $bgcolor,
    -$width 0 0 $width $bgcolor,
    4*$width 0 $color, 
    -4*$width 0 $color,
    0 (-4*$width) $color, 
    0 4*$width $color,
    2*$width 0 0 $width $color,
    -2*$width 0 0 $width $color,
    0 2*$width 0 $width $color,
    0 (-2*$width) 0 $width $color,
    0 0 0 2*$width $color;
    margin: 4*$width auto;
}
@mixin other( $width, $color, $bgcolor ) {
  box-shadow:
    4*$width 0 $bgcolor, 
    -4*$width 0 $bgcolor, 
    0 (-4*$width) $bgcolor, 
    0 4*$width $bgcolor,
    $width 0 0 2*$width $bgcolor,
    -$width 0 0 2*$width $bgcolor,
    0 (-$width) 0 2*$width $bgcolor,
    0 $width 0 2*$width $bgcolor,
    5*$width 0 $color, 
    -5*$width 0 $color,
    0 (-5*$width) $color, 
    0 5*$width $color,
    0 0 0 3*$width $color,
    0 2*$width 0 2*$width $color,
    0 (-2*$width) 0 2*$width $color,
    2*$width 0 0 2*$width $color,
    (-2*$width) 0 0 2*$width $color;
    margin: 5*$width auto;
}
.lvl1 {
  @include other( 4px, orange, white );
}
.lvl2 {
  @include step2v2( 4px, blue, white );
}
.lvl3 {
  @include step3v2( 3px, red, white );
}
.lvl4 {
  @include step4( 5px, green, white );
}
.other {
  @include step1( 6px, black );
}
              
            
!

JS

              
                
              
            
!
999px

Console