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

              
                link(rel="stylesheet", href="css/number-buttons.css")

h1 Numbered Buttons
.number-buttons
  a.number-button(href="#") Home
  a.number-button(href="#") About
  a.number-button(href="#") Portfolio
  a.number-button(href="#") Contact
p Automatically numbered using CSS counter (the ol is for suckers) and a ton of gradients and box-shadows. Change the colors of the buttons with two color variables!
p
  small
    | Based off of &nbsp;
    a(href="https://tympanus.net/codrops/2012/01/11/css-buttons-with-pseudo-elements/", target="_blank") this codrops tutorial
    | .
              
            
!

CSS

              
                vendor(prop, args)
  -webkit-{prop} args
  -moz-{prop} args
  {prop} args

bg-gradient(start, stop)
  background: start
  background: -moz-linear-gradient(top,  start 0%, stop 100%)
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,start), color-stop(100%,stop))
  background: -webkit-linear-gradient(top,  start 0%,stop 100%)
  background: -o-linear-gradient(top,  start 0%,stop 100%)
  background: -ms-linear-gradient(top,  start 0%,stop 100%)
  background: linear-gradient(to bottom,  start 0%,stop 100%)

@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400, 700")

// Change ALL the colors with these two variables!
bright=rgb(44,160,202)
dark= rgb(62,184,229)

body
  font-family: "Source Sans Pro"

.number-buttons
  counter-reset: button-numbers
  width: 320px
  margin 0 auto
  background: WhiteSmoke
  padding: 30px 20px 30px 50px
  border: 1px solid #ccc
  vendor(border-radius, 10px)

h1, p, small
  width: 380px
  margin: 20px auto 10px auto
  font-weight: 200
  
h1
  font-size: 2em

p, small
  text-align: center
  line-height: 1.4em
  
 small
  font-size: 0.7em

a
  color: dark
  text-decoration: none
  font-weight: normal

a.number-button
  background-color: lighten(bright, 10)
  font-weight: normal
  font-size: 12px
  text-decoration: none
  color: #fff
  position: relative
  padding: 10px 20px 9px 20px
  border-left: solid 1px dark
  margin-left: 35px
  width: 100px
  display: block
  margin: 10px auto
  -webkit-border-top-right-radius: 5px
  -webkit-border-bottom-right-radius: 5px
  -moz-border-radius-topright: 5px
  -moz-border-radius-bottomright: 5px
  border-top-right-radius: 5px
  border-bottom-right-radius: 5px
  bg-gradient(bright, dark)
  shadows = inset 0px 1px 0px lighten(bright, 20), 0px 5px 0px 0px darken(dark, 25), 0px 10px 5px #999
  vendor(box-shadow, shadows)

  &:before
    counter-increment: button-numbers
    content: counter(button-numbers)
    background-color: dark
    width: 35px
    max-height: 29px
    padding: 7px 0 8px 0
    position: absolute
    display: block
    top: 0px
    left: -36px
    font-size: 16px
    font-weight: 700
    color: lighten(bright, 30)
    text-shadow: 1px 1px 0px darken(dark, 40)
    border-right: solid 1px darken(dark, 40)
    text-align: center
    bg-gradient(darken(dark, 30), darken(dark, 25))
    -webkit-border-top-left-radius: 5px
    -webkit-border-bottom-left-radius: 5px
    -moz-border-radius-topleft: 5px
    -moz-border-radius-bottomleft: 5px
    border-top-left-radius: 5px
    border-bottom-left-radius: 5px
    shadows = inset 0px 1px 0px dark, 0px 5px 0px 0px darken(dark, 35), 0px 10px 5px #999
    vendor(box-shadow, shadows)

  &:active
    top:3px
    bg-gradient(dark, bright)
    shadows = inset 0px 1px 0px lighten(bright, 20), 0px 2px 0px 0px darken(dark, 25), 0px 5px 3px #999
    vendor(box-shadow, shadows)

    &:before
      top:-3px
      shadows = inset 0px 1px 0px dark, 0px 5px 0px 0px darken(dark, 35), 1px 1px 0px 0px darken(dark, 25), 2px 2px 0px 0px darken(dark, 25), 2px 5px 0px 0px darken(dark, 25), 3px 4px 2px darken(dark, 20), 0px 10px 5px #999
      vendor(box-shadow, shadows)
              
            
!

JS

              
                // Just for the codepen demo
$(function(){
  $('a.number-button').on('click', function(e){
    e.preventDefault();
  });
})
              
            
!
999px

Console