cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <section class="section button-section">
  <div class="title">
    <h2>Rounded Corner</h2></div>
  <div id="buttons" class="button-wrap">
    <div class="row">
      <pre>&lt;button class="button button-round button-icon"&gt;&lt;/button&gt;</pre>
      <button class="button">Apple</button>
      <button class="button">Orange</button>
      <button class="button button-round">Banana</button>
      <button class="button button-round button-icon">
         <i class="fa fa-camera-retro"></i>
          Grapes
      </button>
      <button class="button button-default button-icon-circle button-icon">
       <i class="fa fa-camera-retro"></i>
      </button>
    </div>
    <div class="row">
      <pre>&lt;button class="button (button-secondary button-info button-success button-danger button-warning)"&gt;&lt;/button&gt;</pre>
      <button class="button">Default</button>
      <button class="button button-secondary">Secondary</button>
      <button class="button button-info">Info</button>
      <button class="button button-success">Success</button>
      <button class="button button-danger">Danger</button>
      <button class="button button-warning">Warning</button>
    </div>
  </div>
  <div class="title">
    <h2>Sharp Edges</h2></div>
  <div id="buttons" class="button-wrap">
    <div class="row">
      <pre>&lt;button class="button button-flat"&gt;&lt;/button&gt;</pre>
      <button class="button button-flat">Default</button>
      <button class="button button-secondary button-flat">Secondary</button>
      <button class="button button-info button-flat">Info</button>
      <button class="button button-success button-flat">Success</button>
      <button class="button button-danger button-flat">Danger</button>
      <button class="button button-warning button-flat">Warning</button>
    </div>
  </div>
  <div class="title">
    <h2>Ghost Button</h2></div>
  <div id="buttons" class="button-wrap">
    <div class="row">
      <pre>&lt;button class="button button-border"&gt;&lt;/button&gt;</pre>
      <button class="button button-border button-round">Round</button>
      <button class="button button-secondary button-border button-round">Border</button>
      <button class="button button-info button-border">Normal</button>
      <button class="button button-success button-border button-round">Round</button>
      <button class="button button-danger button-flat button-border">Flat</button>
      <button class="button button-warning button-border button-round">Round</button>
    </div>
  </div>
  <div class="title">
      <h2>Disabled</h2></div>
    <div id="buttons" class="button-wrap">
      <div class="row">
        <pre>&lt;button class="button button-disabled"&gt;&lt;/button&gt;</pre>
        <button class="button button-disabled">Telephone</button>
        <button class="button button-round button-disabled">Camera</button>
        <button class="button button-flat button-disabled">TV</button>
      </div>
    </div>
</section>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Josefin+Sans:300,400,400i,600,700');

//Color-palete
$black: #66615B;
$grey: #ccc;
$white: #fff;
$yellow: #ff0;
$green: #8bc34a;
$blue: #29d2e4;
$orange: #f87d09;
$dark-pink: #e91e63;
$purple: #9c27b0;
$light-purple: #efedff;

//Types
$button-primary-bg-color: $black;
$button-info-bg-color: $blue;
$button-danger-bg-color: $dark-pink;
$button-warning-bg-color: $orange;
$button-success-bg-color: $green;

//Size
$button-padding-vertical: 10px;
$button-padding-horizontal: 15px;

//Body
$main-background: $light-purple;

*,
:after,
:before {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font: normal 16px/1.2 'Josefin Sans', sans-serif;
  background: $main-background;
}

.button-section {
  padding: 50px 0;
}

.button-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  > .row {
    text-align: center;
    &:not(:first-child){
      margin-top: 10px;
    }
    button {
      margin: 5px;
    }
  }
}

.title h2{
  margin-top: 50px;
  text-align: center;
  font-weight: normal;
}

pre {
  background: $white;
  padding: 15px;
  box-shadow: 0 1px 1px 1px rgba(142, 142, 142, 0.51);
  border-radius: 4px;
  white-space: inherit;
  font-size: 14px;
}

@mixin button-size($button-padding-vertical,$button-padding-horizontal,$button-font-size,$button-line-height,$button-border-radius) {
  padding: $button-padding-vertical $button-padding-horizontal;
  font-size: $button-font-size;
  line-height: $button-line-height;
  border-radius: $button-border-radius;
}

@mixin button-variant($button-text-color,$button-bg-color,$button-border-color) {
  color: $button-text-color;
  background-color: $button-bg-color;
  border-color: $button-border-color;
  transition: all 300ms ease-in-out;

  &:hover,
  &:focus,
  &:active {
    color: $button-text-color;;
    background-color: darken($button-bg-color, 10%);
    border-color: darken($button-border-color, 13%);
  }

  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &:active {
      background-color: $button-bg-color;
      border-color: $button-border-color;
    }
  }
}

.button{
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-image: none;
  border: 1px solid;  
  letter-spacing: 0;
  outline: none;
	@include button-size(10px,30px,14px,1.2,4px);
  @include button-variant($white,$black,$black);
  &.button-secondary {
    @include button-variant($white,$purple,$purple);
    &.button-border{
      &:hover,&:focus {
        background: $purple;
        border-color: $purple;
        color: $white;
      }
    }
  }
  &.button-info {
    @include button-variant($white,$blue,$blue);
    &.button-border{
      &:hover,&:focus {
        background: $blue;
        border-color: $blue;
        color: $white;
      }
    }
  }
  &.button-success {
    @include button-variant($white,$green,$green);
    &.button-border{
      &:hover,&:focus {
        background: $green;
        border-color: $green;
        color: $white;
      }
    }
  }
  &.button-danger {
    @include button-variant($white,$dark-pink,$dark-pink);
    &.button-border{
      &:hover,&:focus {
        background: $dark-pink;
        border-color: $dark-pink;
        color: $white;
      }
    }
  }
  &.button-warning {
    @include button-variant($white,$orange,$orange);
    &.button-border{
      &:hover,&:focus {
        background: $orange;
        border-color: $orange;
        color: $white;
      }
    }
  }
  &.button-round {
    border-radius: 30px;
  }
  &.button-icon-circle{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
  }
  &.button-flat {
    border-radius: 0;
  }
  &.button-border{
    background: none;
    color: $black;
    border-width: 2px;
    &:hover,&:focus {
      background: $black;
      border-color: $black;
      color: $white;
    }
  }
  &.button-disabled {
    @include button-variant(#efefef,#d4d4d4,#d4d4d4);
    background: #d4d4d4;
    color: #efefef;
    border: #d4d4d4;
    cursor: not-allowed;
    &:hover , &:focus {
      background: #d4d4d4 !important;
    }
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console