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

              
                <h1>Chrome/Glass Buttons</h1>

<article>
  <nav class="btn-bar nav-light">
    <a href="#" class="btn btn-glass">
      Default
    </a>
    <a href="#" class="btn btn-glass btn-primary">
      <i class="fa fa-fw fa-lg fa-chevron-right"></i> Primary
    </a>
    <a href="#" class="btn btn-glass btn-success">
      <i class="fa fa-fw fa-lg fa-check"></i> Success
    </a>
    <a href="#" class="btn btn-glass btn-warning">
      <i class="fa fa-fw fa-lg fa-exclamation "></i> Warning
    </a>
    <a href="#" class="btn btn-glass btn-danger">
      <i class="fa fa-fw fa-lg fa-times"></i> Danger
    </a>
    <a href="#" class="btn btn-glass btn-info">
      <i class="fa fa-fw fa-lg fa-info "></i> Info
    </a>
  </nav>
</article>

<article>
  <nav class="btn-bar nav-dark">
    <a href="#" class="btn btn-glass">
      Default
    </a>
    <a href="#" class="btn btn-glass btn-primary">
      <i class="fa fa-fw fa-lg fa-chevron-right"></i> Primary
    </a>
    <a href="#" class="btn btn-glass btn-success">
      <i class="fa fa-fw fa-lg fa-check"></i> Success
    </a>
    <a href="#" class="btn btn-glass btn-warning">
      <i class="fa fa-fw fa-lg fa-exclamation "></i> Warning
    </a>
    <a href="#" class="btn btn-glass btn-danger">
      <i class="fa fa-fw fa-lg fa-times"></i> Danger
    </a>
    <a href="#" class="btn btn-glass btn-info">
      <i class="fa fa-fw fa-lg fa-info "></i> Info
    </a>
  </nav>
</article>

<article>
  <section>
    Are you sure you want to delete <code>somefile.txt</code>?
  </section>
  <nav class="btn-bar nav-light">
    <a href="#" class="btn btn-glass btn-success">
      <i class="fa fa-fw fa-lg fa-check"></i> Ok
    </a>
    <a href="#" class="btn btn-glass btn-danger">
      <i class="fa fa-fw fa-lg fa-times"></i> No
    </a>
  </nav>
</article>

<article>
  <section>
    <h2>Check out when they scroll...</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit, nisi voluptate tempora ea molestias vel! Mollitia architecto, accusamus nulla rerum magnam, nisi, facilis praesentium, aut quia placeat tempora voluptatem repudiandae!</p>
    <p>Nesciunt, molestias commodi totam vitae, voluptates debitis repellendus modi dicta dolores dolorem beatae laboriosam eaque, sed. Dolorem fuga voluptatibus vero eveniet iure. Sed nemo saepe delectus, expedita asperiores, dolor illo.</p>
    <p>Cum aspernatur, quidem dolorum accusamus quod vel, rem inventore tempora voluptas dolore deserunt eveniet doloribus obcaecati nesciunt error in illum, molestias explicabo corrupti commodi natus dicta placeat. A, laudantium, impedit.</p>
  </section>
  <nav class="btn-bar nav-dark">
    <a href="#" class="btn btn-glass btn-success">
      <i class="fa fa-fw fa-lg fa-check"></i> Approve
    </a>
    <a href="#" class="btn btn-glass btn-danger">
      <i class="fa fa-fw fa-lg fa-times"></i> Reject
    </a>
    <a href="#" class="btn btn-glass btn-info">
      <i class="fa fa-fw fa-lg fa-code"></i> Diff
    </a>
  </nav>
</article>

              
            
!

CSS

              
                @clr-default: #444;
@clr-primary: #2A8FBD;
@clr-success: #7FAF1B;
@clr-warning: #FBB829;
@clr-danger:  #F02311;
@clr-info:    #6CDFEA;

@b: 7.5%;
@gloss:
  repeating-linear-gradient(-45deg, 
      fade(white, 0%) 8%,
      fade(white, @b) 10%,
      
      fade(white, @b) 14%,
      fade(white, @b*2) 14%,
      fade(white, @b*2) 15%,
      fade(white, @b) 17%,
      fade(white, 0%) 30%,

      fade(white, 0%) 36%,
      fade(white, @b) 40%,
      fade(white, @b*2) 42%,
      fade(white, 0%) 43%,
    
    
      fade(white, 0%) 55%,
      fade(white, @b) 60%,
      
      fade(white, @b) 66%,
      fade(white, @b*2) 66%,
      fade(white, @b) 70%,
      fade(white, 0%) 75%,
      fade(white, 0%) 100%);


.colorize-l(@base) {
  color: mix(@base, white, 70%);
  background-color: fade(@base, 0%);
  &:hover {
    color: fade(white, 70%);
    border-color: darken(@base,15%);
    background-color: @base;
  }
  &:active {
    position: relative;
    z-index: 1;
    box-shadow: 0 0 1em 0.5ex fade(@base, 50%);
  }
}

.colorize-d(@base) {
  color: fade(white, 70%);
  background-color: fade(@base, 0%);
  &:hover {
    border-color: darken(@base,15%);
    background-color: @base;
  }
  &:active {
    position: relative;
    z-index: 1;
    box-shadow: 0 0 1em 0.5ex fade(@base, 50%);
  }
}


.btn-glass {
  flex-grow: 1;
  text-align: center;
  display: inline-block;
  color: fade(white, 70%);
  text-decoration: none;
  padding: 1em 2em;
  font-family: Lato;
  font-weight: 300;
  border: 1px dotted transparent;
  letter-spacing: 0.98pt;
  text-transform: uppercase;
  //text-shadow: 0 0 5px black;
  
  transition: background-position 2s cubic-bezier(0,1,0,1),
    border-color 500ms,
    background-color 500ms;
  
  &:hover {
    background-position: -100vw 0, 0 0;
  }
  
  &:active {
    background-position: -75vw 0, 0 0;
    border-style: solid;
  }
  
  position: relative;
  
  background-attachment: fixed, scroll;
  background-size: 100vw 100vh, cover;
  background-position: center center, 0 0;
  background-image: @gloss,
    radial-gradient(ellipse farthest-corner, transparent, fade(black,20%) 110%);
}

.nav-light {
  background-color: white;
  .btn-glass { .colorize-l(darken(@clr-default, 20%)); }
  .btn-glass.btn-primary { .colorize-l(@clr-primary); }
  .btn-glass.btn-success { .colorize-l(@clr-success); }
  .btn-glass.btn-warning { .colorize-l(@clr-warning); }
  .btn-glass.btn-danger { .colorize-l(@clr-danger); }
  .btn-glass.btn-info { .colorize-l(@clr-info); }
}


.nav-dark {
  background-color: @clr-default;
  .btn-glass { .colorize-d(darken(@clr-default, 20%)); }
  .btn-glass.btn-primary { .colorize-d(@clr-primary); }
  .btn-glass.btn-success { .colorize-d(@clr-success); }
  .btn-glass.btn-warning { .colorize-d(@clr-warning); }
  .btn-glass.btn-danger { .colorize-d(@clr-danger); }
  .btn-glass.btn-info { .colorize-d(@clr-info); }
}

nav.btn-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  //background-color: @clr-default;
}

// page junk
:root {
  font-family: 'Open Sans', sans;
  font-size: 11pt;
  line-height: 1.6;
  min-height: 100vh;
  background-attachment: fixed, scroll;
  background-image:
    url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/49914/grit-fs8.png),
    radial-gradient(ellipse farthest-corner, #555, #999);
}

body { 
  width: 75vw;
  margin: 4em auto;
  line-height: inherit;
}

article {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 2px;
  box-sizing: border-box;
  background-color: white;
  box-shadow: 0 1ex 1em fade(black, 30%);
}

code {
  font-family: monospace;
  display: inline-block;
  padding: 0.5ex 1ch 0.25ex 1ch;
  background-color: #ccc;
  border-radius: 1ex;
  margin: 0 0.5ch;
}

article + article {
  margin-top: 4em;
}

article section {
  margin: 2em;  
}

article>section>h2 { font-family: 'Lato'; font-weight: 800; font-size: 1.3em; margin-bottom: 0.8em; }
article>section>p { margin-bottom: 1em; text-indent: 2ch; }
article>section>p:first-child,
article>section>h2+p { text-indent: 0; }
h1 {
  font-family: 'Lato'; font-weight: 800; text-align: center;
  font-size: 75vw/15;
  color: fade(white, 30%);
}

              
            
!

JS

              
                
              
            
!
999px

Console