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

              
                <body ontouchstart="">
  <div class="global-counter">0</div>

  <div class="header">
    <h1><strong>Obvious</strong> Buttons</h1>
    <p class="gh-link">
      <a href="https://github.com/skidding/obvious-buttons" target="_blank">go to GitHub <i class="fa fa-github-alt"></i></a>
    </p>
  </div>
  <p class="subtitle"><em>Almost flat</em> CSS buttons</p>


  <div class="buttons top-space">
    <h3>.button-small</h3>
    <a href="#nada" class="button button-inline button-small"><span>click me</span></a><a
                                                                                          href="#nada" class="button button-inline button-small button-primary"><span>click me</span></a><a
       href="#nada" class="button button-inline button-small button-info"><span>click me</span></a><a
                                                                                                      href="#nada" class="button button-inline button-small button-success"><span>click me</span></a><a
       href="#nada" class="button button-inline button-small button-warning"><span>click me</span></a><a
                                                                                                         href="#nada" class="button button-inline button-small button-danger"><span>click me</span></a><a
       href="#nada" class="button button-inline button-small button-inverse"><span>click me</span></a>
    <h3>.button</h3>
    <a href="#nada" class="button button-inline"><span>click me</span></a><a
                                                                             href="#nada" class="button button-inline button-primary"><span>click me</span></a><a
       href="#nada" class="button button-inline button-info"><span>click me</span></a><a
                                                                                         href="#nada" class="button button-inline button-success"><span>click me</span></a><a
       href="#nada" class="button button-inline button-warning"><span>click me</span></a><a
                                                                                            href="#nada" class="button button-inline button-danger"><span>click me</span></a><a
       href="#nada" class="button button-inline button-inverse"><span>click me</span></a>
    <h3>.button-large</h3>
    <a href="#nada" class="button button-inline button-large"><span>click me</span></a><a
                                                                                          href="#nada" class="button button-inline button-large button-primary"><span>click me</span></a><a
       href="#nada" class="button button-inline button-large button-info"><span>click me</span></a><a
                                                                                                      href="#nada" class="button button-inline button-large button-success"><span>click me</span></a><a
       href="#nada" class="button button-inline button-large button-warning"><span>click me</span></a><a
                                                                                                         href="#nada" class="button button-inline button-large button-danger"><span>click me</span></a><a
       href="#nada" class="button button-inline button-large button-inverse"><span>click me</span></a>
    <h3>.button-xlarge</h3>
    <a href="#nada" class="button button-inline button-xlarge"><span><em>lick</em> me</span></a><a
                                                                                                   href="#nada" class="button button-inline button-xlarge button-primary"><span><em>lick</em> me</span></a><a
       href="#nada" class="button button-inline button-xlarge button-info"><span><em>lick</em> me</span></a><a
                                                                                                               href="#nada" class="button button-inline button-xlarge button-success"><span><em>lick</em> me</span></a><a
       href="#nada" class="button button-inline button-xlarge button-warning"><span><em>lick</em> me</span></a><a
                                                                                                                  href="#nada" class="button button-inline button-xlarge button-danger"><span><em>lick</em> me</span></a><a
       href="#nada" class="button button-inline button-xlarge button-inverse"><span><em>lick</em> me</span></a>
  </div>

  <h2>They work great with <a href="http://fontawesome.io" target="_blank">FontAwesome</a></h2>
  <div class="buttons">
    <a href="#nada" class="button button-inline"><span><i class="fa fa-home"></i></span></a><a
                                                                                               href="#nada" class="button button-inline"><span><i class="fa fa-bar-chart-o"></i> click me</span></a><a
       href="#nada" class="button button-inline"><span>click me <i class="fa fa-music"></i> </span></a><a
                                                                                                          href="#nada" class="button button-inline"><span>click <i class="fa fa-globe"></i> me</span></a>
  </div>

  <h2>Shameless plug: <a href="https://github.com/skidding/dragdealer" target="_blank">Dragdealer.js</a> integration</h2>
  <div class="left-align">
    <div id="flat-slider" class="dragdealer">
      <div class="handle button button-large button-danger"><span>drag me</span></div>
    </div>
  </div>

  <p class="top-space">&copy; 2015+ <a href="https://twitter.com/skidding" target="_blank">@skidding</a> — Best regards</p>
</body>
              
            
!

CSS

              
                /* ======================================== \
 ================ DEMO CSS ================
\========================================= */

// Fonts
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700&subset=latin,latin-ext);

body {
  margin: 30px;
  padding: 0;
  background: #fff;
  color: #222;
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 20px;
}
a {
  color: #0088cc;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
p {
  margin: 15px 0;
}
.header {
  position: relative;
  margin: 30px 0 10px 0;
}
  .header h1 {
    margin: 0;
    font-size: 50px;
    font-weight: 300;
    line-height: 50px;
    letter-spacing: -2px;
  }
  .header .gh-link {
    position: absolute;
    top: 2px;
    left: 380px;
    margin: 0;
    padding: 0 0 0 15px;
    border-left: 2px solid #222;
    font-size: 18px;
    line-height: 50px;
    white-space: nowrap;
  }
.subtitle {
  margin: 10px 0 30px 0;
  color: #666;
  font-size: 18px;
  line-height: 22px;
}
h2 {
  margin: 30px 0 20px 0;
  color: #666;
  font-size: 24px;
  font-weight: 300;
  line-height: 1em;
}
  h2 a {
    color: #222;
  }
h3 {
  margin: 15px 0 10px 0;
  color: #888;
  font-family: Monaco, "Lucida Console", monospace;
  font-weight: normal;
  font-size: 16px;
  line-height: 20px;
}
.left-align {
  width: 740px;
}
.buttons {
  white-space: nowrap;
}
  .buttons .button {
    margin: 0 5px 5px 0;
  }

.global-counter {
  float: right;
  color: #666;
  font-size: 50px;
  font-weight: 600;
  line-height: 1em;
}
#flat-slider {
  height: 50px;
  border-radius: 6px;
}
  #flat-slider .handle {
    width: 120px;
    padding: 0;
    text-align: center;
  }
.top-space {
  margin-top: 30px;
}


/* ======================================== \
 ========== OBVIOUS BUTTONS CSS ===========
\========================================= */
/**
 * Obvious Buttons 0.1
 * https://github.com/skidding/obvious-buttons
 *
 * (c) 2014+ Ovidiu Cherecheș
 * http://skidding.mit-license.org
 */
// Variables

@default-background-color: #fafafa;
@default-text-color: #222;

@primary-background-color: #0088cc;
@primary-text-color: #fafafa;

@info-background-color: #49afcd;
@info-text-color: #fafafa;

@success-background-color: #5bb75b;
@success-text-color: #fafafa;

@warning-background-color: #faa732;
@warning-text-color: #fafafa;

@danger-background-color: #da4f49;
@danger-text-color: #fafafa;

@inverse-background-color: #363636;
@inverse-text-color: #fafafa;


// Cross-browser helpers

.boxShadow (@statement) {
  -webkit-box-shadow: @statement;
  -moz-box-shadow: @statement;
  box-shadow: @statement;
}
.transition (@property, @duration, @transition: linear) {
  -webkit-transition-property: @property;
  -webkit-transition-duration: @duration;
  -webkit-transition-timing-function: @transition;
  -moz-transition-property: @property;
  -moz-transition-duration: @duration;
  -moz-transition-timing-function: @transition;
  -ms-transition-property: @property;
  -ms-transition-duration: @duration;
  -ms-transition-timing-function: @transition;
  -o-transition-property: @property;
  -o-transition-duration: @duration;
  -o-transition-timing-function: @transition;
  transition-property: @property;
  transition-duration: @duration;
  transition-timing-function: @transition;
}


.buttonColor (@background, @text) {
  background: @background;
  color: @text;

  &:hover,
  &:focus {
    background: darken(@background, 8%);
    color: @text;
  }
}
.buttonSize (@height, @depth, @font-size) {
  height: @height;
  // Fine-tuned to look match font size
  padding: 0 @font-size - 4;
  border-radius: @depth + 2;
  // Make button look 3D by giving a thicker border at the bottom
  .boxShadow(inset 0 -@depth 0 0 rgba(0, 0, 0, 0.15));
  font-size: @font-size;
  line-height: @height - @depth;

  i {
    line-height: @height - @depth;
  }
  &:active, &:active i {
    line-height: @height;
  }
  &.button-primary, &.button-info, &.button-success, &.button-warning, &.button-danger, &.button-inverse {
    .boxShadow(inset 0 -@depth 0 0 rgba(0, 0, 0, 0.2));
  }
}

.button {
  // Add .button-inline class for inline-block display
  display: block;
  text-align: center;
  cursor: pointer;
  border: none;
  .buttonSize(40px, 3px, 18px);
  .transition(background-color, 0.2s);
  .buttonColor(@default-background-color, @default-text-color);

  &.button-primary {
    .buttonColor(@primary-background-color, @primary-text-color);
  }
  &.button-info {
    .buttonColor(@info-background-color, @info-text-color);
  }
  &.button-success {
    .buttonColor(@success-background-color, @success-text-color);
  }
  &.button-warning {
    .buttonColor(@warning-background-color, @warning-text-color);
  }
  &.button-danger {
    .buttonColor(@danger-background-color, @danger-text-color);
  }
  &.button-inverse {
    .buttonColor(@inverse-background-color, @inverse-text-color);
  }

  span {
    // We need this extra span because there's a WebKit bug that sometimes
    // misses click events when the text inside a the element moves between
    // mousedown and mouseup: http://stackoverflow.com/q/15679787/128816
    pointer-events: none;
  }

  &:hover {
    text-decoration: none;
  }
  &:focus {
    text-decoration: none;
    outline: none;
  }
  &:active {
    // Remove excess of bottom border when clicking on the button in order to
    // make it seem like it's physically pressed
    .boxShadow(~"none !important");
  }
}
.button-small {
  .buttonSize(30px, 2px, 14px);
}
.button-large {
  .buttonSize(50px, 4px, 22px);
}
.button-xlarge {
  .buttonSize(60px, 5px, 26px);
}


.button-inline {
  display: inline-block;
  vertical-align: middle;
}

              
            
!

JS

              
                $(function() {
  new Dragdealer('flat-slider');

  var globalCounter = 0;
  $('.button').click(function(e) {
    e.preventDefault();
    $('.global-counter').text(++globalCounter);
  });
});
              
            
!
999px

Console