Pen Settings

HTML

CSS

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

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

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.

HTML

              
                

<div class="wrapper">
  
  <h1>Button Library - Inputs and Buttons</h1>
  
  <div class="holder">
    <div class="title"><h2>@include button_basic();</h2></div>
    <div class="container container1">
      <input type="submit" class="button" value="The Basic Input">
      <button class="button" type="submit">The Basic Button</button>
    </div>
  </div>
  
  <div class="holder">
    <div class="title"><h2>@include button_icon();</h2></div>
    <div class="container container2">
      <input type="submit" class="button" value="The Icon Slide Input">
      <button class="button" type="submit">The Icon Slide Button</button>
    </div>
  </div>
  
  <div class="holder">
    <div class="title"><h2>@include button_3D();</h2></div>
    <div class="container container3">
      <input type="submit" class="button" value="The 3D Input">
      <button class="button" type="submit">The 3D Button</button>
    </div>
  </div>
  
  <div class="holder">
    <div class="title"><h2>@include button_outline();</h2></div>
    <div class="container container4">
      <input type="submit" class="button" value="The Outlined Input">
      <button class="button" type="submit">The Outlined Button</button>
    </div>
  </div>
<!--  
  <div class="holder">
    <div class="title"><h2>@include button_flat();</h2></div>
    <div class="container container5">
      <input type="submit" class="button" value="The Flat Input">
      <button class="button" type="submit">The Flat Button</button>
    </div>
  </div> -->
  
  <div class="holder">
    <div class="title"><h2>@include button_depth();</h2></div>
    <div class="container container6">
      <input type="submit" class="button" value="The Depth Input">
      <button class="button" type="submit">The Depth Button</button>
    </div>
  </div>
</div>

              
            
!

CSS

              
                @import "compass/css3";

//For Library Display
@import url(https://fonts.googleapis.com/css?family=Lora);
@import url(https://fonts.googleapis.com/css?family=Lato);

$background: #eee;
$lato: 'Lato', sans-serif;
$lora: 'Lora', serif;
$fontColor: #888;

@font-face {
  font-family: "SSSymbolicons";
  src: url('http://www.astonish.com/wp-content/themes/astonishing_brewer/fonts/icons/ss-symbolicons/ss-symbolicons-block.eot');
  src: url('http://www.astonish.com/wp-content/themes/astonishing_brewer/fonts/icons/ss-symbolicons/ss-symbolicons-block.eot?#iefix') format('embedded-opentype'),
       url('http://www.astonish.com/wp-content/themes/astonishing_brewer/fonts/icons/ss-symbolicons/ss-symbolicons-block.woff') format('woff'),
       url('http://www.astonish.com/wp-content/themes/astonishing_brewer/fonts/icons/ss-symbolicons/ss-symbolicons-block.ttf')  format('truetype'),
       url('http://www.astonish.com/wp-content/themes/astonishing_brewer/fonts/icons/ss-symbolicons/ss-symbolicons-block.svg#SSSymboliconsBlock') format('svg');
  font-weight: normal;
  font-style: normal;
}

.wrapper {
  width: 1000px;
  height: auto;
  margin: 0px auto;
  color: $fontColor;

    h1 {
      text-align: center;
      font-family: $lato;
      margin: 40px 0 25px 0;
      display: block;
      clear: both;
      float: none;
      width: 100%;
      float: left;
    }

    .holder {
      width: 100%;
      float: left;
      margin: 20px 0px;
      box-shadow: 0px 0px 16px $background;
      display: table;

        .title {
          vertical-align: middle;
          width: 37%;
          display: table-cell;
        }

        h2 {
          text-align: left;
          margin-left: 40px;
          font-family: $lato;
          font-size: 20px;
        }

        .container {
          width: 100%;
          height: auto;
          float: right;
          text-align: center;
          display: table-cell;
        }
      
    }
  
}

// Basic Button Styles

.button {
  border: none;
  min-height: 35px;
  padding: 15px;
  min-width: 150px;
  font-size: 16px;
  cursor: pointer;
  margin: 20px;
  &:focus {
    outline: none;
  }
}

@function dynamicColor ( $color ) {
	@if lightness($color) < 50% {
		@return #f1f1f1;
	} @else {
		@return #111;
	}
}

$colorDefault: #72A410;
$fontDefault: $lato;
$radiusDefault: 0px;
$stageDefault: transparent;

//Mixin Variables (color, font, radius, stage[the background] )

//Button 1 - Basic
@mixin button_basic($color: $colorDefault, $font: $fontDefault, $radius: $radiusDefault){
  background: $color;
  border: 1px solid darken($color, 10%);
  border-radius: $radius;
  box-shadow: inset 0 1px 0 lighten($color, 30%);
  color: dynamicColor($color);
  font-family: $font;
  font-size: 16px;
  font-weight: normal;
  &:hover {
		background: darken($color, 10%);
		color: dynamicColor(darken($color, 10%));
	}
}

//Button 2 - MLC Arrow
@mixin button_icon( $color: $colorDefault, $font: $fontDefault, $radius: 3px, $icon: ''){
    border-radius: $radius;
    color: dynamicColor($color);
    text-shadow: 1px 1px rgba( darken($color, 40%), 0.3);
    padding: 12px 18px;
    position: relative;
    overflow: hidden;
    @include box-shadow(0 1px 1px rgba(0,0,0,.20), inset 0 2px rgba(255,255,255,.30));
    border: solid 1px darken($color, 13%);
    @include background-image (linear-gradient( top, rgba(255,255,255,.30), rgba(255,255,255,0)));
    background-color: $color;
    @include transition(background-color 300ms);
    @if $icon != ''{
        padding-right: 40px;
        @include transition(padding 300ms);
        &:after{
            content: $icon;
            position: absolute;
            top: 11px;
            right: 14px;
            font-family: "SSSymbolicons";
            font-size: 18px;
            font-style: normal;
            font-weight: normal;
            text-decoration: none;
            text-rendering: optimizeLegibility;
            white-space: nowrap;
            -moz-font-feature-settings: "liga=1";
            -moz-font-feature-settings: "liga";
            -ms-font-feature-settings: "liga" 1;
            -o-font-feature-settings: "liga";
            font-feature-settings: "liga";
            -webkit-font-smoothing: antialiased;
            @include transition(right 300ms ease-out);
        }
        &:hover{
            padding-left: 29px;
            padding-right: 29px;
            &:after{
                right: -18px;
            }
        }
   }
   &:hover{
       @include background-image (linear-gradient( top, rgba(255,255,255,.20), rgba(255,255,255,0)));
       background-color: darken($color, 10%);
   }
}

//Button 3 - Loiselle
@mixin button_3D($color: $colorDefault, $font: $fontDefault, $radius: 5px){
  background-color: $color;
  border-radius: $radius;
  color: dynamicColor($color);
  font-family: $font;
  font-weight: bold;
  padding: 10px 40px;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px rgba( darken($color, 40%), 0.3);
  @include box-shadow(0px 3px rgba(darken($color, 20%),1), 
    0px 4px rgba(darken($color, 23%),1),
    0px 5px rgba(darken($color, 26%),1),
    0px 6px rgba(darken($color, 29%),1),
    0px 7px rgba(darken($color, 32%),1),
    0px 8px rgba(darken($color, 36%),1),
    0px 12px 6px -1px rgba(0,0,0,.5), 
    //inner glow & drop shadow
    inset 0 1px 1px rgba(255,255,255,.7), inset 0 0 3px rgba(252,252,252,.6));
    	border: solid 1px darken($color, 20%);
	    @include background-image(linear-gradient(to top, rgba(0,0,0,.14), rgba(255,255,255,.14)));
    @include transition(transform 100ms, box-shadow 100ms, background-color 200ms, color 200ms);
    &:hover{
      background-color: darken($color, 10%);
    }
    &:active{
      @include transform(translateY(5px));
      @include box-shadow(0px 3px rgba(darken($color, 20%),1), 
      /* gradient effects */
        0px 1px rgba(darken($color, 32%),1),
        0px 5px 2px 0px rgba(0,0,0,.4), 
        //inner glow & drop shadow
        inset 0 1px 1px rgba(255,255,255,.7), inset 0 0 3px rgba(252,252,252,.6));
      
      // Proper Shadows
      @include box-shadow(
	0px 3px rgba(darken($color, 20%),1), 
    0px 3px rgba(darken($color, 23%),1),
    0px 3px rgba(darken($color, 26%),1),
    0px 3px rgba(darken($color, 29%),1),
    0px 3px rgba(darken($color, 32%),1),
    0px 3px rgba(darken($color, 36%),1),
    0px 5px 2px 0px rgba(0,0,0,.4), 
    inset 0 1px 1px rgba(255,255,255,.7),
    inset 0 0 3px rgba(252,252,252,.6));
    }
}

//Button 4 - Outlined
@mixin button_outline($color: $colorDefault, $font: $fontDefault, $radius: $radiusDefault){
  background: none;
  border: 3px solid $color;
  border-radius: $radius;
  color: $color;
  font-family: $font;
  @include transition(all 300ms);
  &:hover {
    background: $color;
    color: dynamicColor($color);
  }
  &:active {
    background: darken($color, 10%);
    color: dynamicColor(darken($color, 10%));
  }
}

//Button 5 - Flat

//Button 6 - Depth
@mixin button_depth($color: $colorDefault, $font: $fontDefault, $radius: $radiusDefault) {
  color: dynamicColor($color);
  $depthBG: linear-gradient(lighten($color, 8%), darken($color, 8%));
  $depthBGFlip: linear-gradient(darken($color, 8%), lighten($color, 8%));
  $depthBGActive: linear-gradient(darken($color, 12%), lighten($color, 6%));
  -moz-background-size: 100%;
  background-size: 100%;
  background-repeat: repeat-x;
  border-radius: $radius;
  box-shadow: 0px 3px 6px rgba(0,0,0,.2);
  @include background-image($depthBG);
  &:hover {
    @include background-image($depthBGFlip);
    box-shadow:  inset 0 0 10px rgba(0,0,0,.2);
    text-shadow: 1px 1px 3px rgba(0,0,0,.4);
  }
   &:active {
     @include background-image($depthBGActive);
    box-shadow:  inset 0 0 10px rgba(0,0,0,.5);
    text-shadow: 1px 1px 3px rgba(0,0,0,.7);
  }
}


//Apply to container

.container1 {
  input.button { @include button_basic(); }
  button.button{ @include button_basic(); }
}
.container2 {
  input.button { @include button_icon(); }
  button.button{ @include button_icon($icon: 'next'); }
}
.container3 {
  input.button { @include button_3D(); }
  button.button{ @include button_3D(); }
}
.container4 {
  input.button { @include button_outline(); }
  button.button{ @include button_outline(); }
}
.container5 {
  .button{ }
}
.container6 {
  input.button { @include button_depth(); }
  button.button{ @include button_depth(); } 
}
.container7 {
  .button{ }
}
.container8 {
  .button{ }
}
.container9 {
  .button{ }
}
    
    
              
            
!

JS

              
                
              
            
!
999px

Console