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 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

              
                <div class="buttons">
  <button class="btn">
    Default
  </button>
  <button class="btn btn-primary">
    Primary
  </button>
  <button class="btn btn-secondary">
    Secondary
  </button>
  <button class="btn btn-success">
    Success
  </button>
  <button class="btn btn-info">
    Info
  </button>
  <button class="btn btn-warning">
    Warning
  </button>
  <button class="btn btn-danger">
    Danger
  </button>
  <button class="btn btn-primary btn-round">
    Round
  </button>
  <button class="btn btn-primary btn-circle">
    <i class="search-icon"></i>
  </button>
  <button class="btn btn-primary disabled">
    Disabled
  </button>
  <button class="btn btn-primary loading">Loading</button>
  <button class="btn btn-primary btn-ghost">Ghost</button>
  <button class="btn btn-primary">
    <i class="plus-icon"></i><span>Icon</span>
  </button>
  <button class="btn btn-primary btn-dashed">Dashed</button>
  <button class="btn btn-primary btn-link">Link</button>
  <button class="btn btn-primary btn-jittery">
    Click Me
  </button>
  <button class="btn btn-primary btn-jelly">
    Jelly
  </button>
  <button class="btn btn-primary btn-ghost btn-fill">
    Fill In
  </button>
  <button class="btn btn-primary btn-pulse">
    Pulse
  </button>
  <button class="btn btn-primary btn-ghost btn-open">
    Open
  </button>
  <button class="btn btn-primary btn-ghost btn-close">
    Close
  </button>
  <button class="btn btn-primary btn-ghost btn-slash">
    Slash
  </button>
  <button class="btn btn-primary btn-ghost btn-fill-up">
    Fill Up
  </button>
  <button class="btn btn-primary btn-ghost btn-slide">
    Slide
  </button>
  <button class="btn btn-primary btn-ghost btn-through">
    Through
  </button>
  <button class="btn btn-primary btn-ghost btn-offset">
    Offset
  </button>
  <button class="btn btn-primary btn-ghost btn-flip-down">
    Flip Down
    <div class="front">Flip Down</div>
    <div class="back">Flip Down</div>
  </button>
  <button class="btn btn-primary btn-round btn-marquee">
    <span data-text="Marquee">Marquee</span>
  </button>
  <button class="btn btn-primary btn-ghost btn-cross">
    Cross Bar
  </button>
  <button class="btn btn-primary btn-ghost btn-open-line">
    Line
  </button>
</div>
              
            
!

CSS

              
                body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.btn {
  margin: 1rem;

  &-jittery {
    animation: jittery 4s infinite;
  }

  &-icon {
    position: relative;
    margin-left: 8px;
    overflow: hidden;

    i {
      position: absolute;
      top: 41%;
      left: 48%;
      transform: scale(0.75) translate(-16%, 400%);
      transition: 0.2s;
    }

    span {
      display: flex;
      justify-content: center;
      align-items: center;
      transition: 0.2s;
    }

    &:hover {
      i {
        transform: scale(0.75) translate(-16%, 0);
      }

      span {
        transform: translateY(-400%);
      }
    }
  }

  &-jelly {
    &:hover {
      animation: jelly 0.5s;
    }
  }

  &-fill {
    transition: 0.3s;

    &:hover {
      background: transparent;
      box-shadow: inset 0 0 0 36px var(--btn-bg);
    }
  }

  &-open {
    transition: 0.3s;

    &::before {
      position: absolute;
      content: "";
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      background: var(--btn-bg);
      transform: scaleX(0);
      transition: 0.3s;
    }

    &:hover {
      background: transparent;

      &::before {
        transform: scaleX(1);
      }
    }
  }

  &-pulse {
    &:hover {
      box-shadow: 0 0 0 18px transparent;
      animation: pulse 1s;
    }
  }

  &-close {
    transition: 0.3s;

    &:hover {
      background: transparent;
      box-shadow: inset 54px 0 0 0 var(--btn-bg),
        inset -54px 0 0 0 var(--btn-bg);
    }
  }

  &-slash {
    overflow: hidden;
    transition: 0.3s;

    &::before {
      position: absolute;
      content: "";
      top: 50%;
      left: 50%;
      z-index: -1;
      width: 120%;
      height: 210%;
      background: var(--btn-bg);
      transform: translate(-50%, -50%) rotate(-45deg) scaleX(0);
      transition: 0.3s;
    }

    &:hover {
      background: transparent;

      &::before {
        transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
      }
    }
  }

  &-fill-up {
    transition: 0.3s;

    &:hover {
      background: transparent;
      box-shadow: inset 0 -54px 0 0 var(--btn-bg);
    }
  }

  &-slide {
    transition: 0.3s;

    &:hover {
      background: transparent;
      box-shadow: inset 90px 0 0 0 var(--btn-bg);
    }
  }

  &-through {
    transition: 0.6s cubic-bezier(0.77, 0, 0.175, 1); // ease-in-out-quartic;

    &::before {
      position: absolute;
      content: "";
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      background: var(--btn-bg);
      transform: scaleX(0);
      transform-origin: right;
      transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    }

    &:hover {
      color: white;
      background: transparent;

      &::before {
        transform: scaleX(1);
        transform-origin: left;
      }
    }
  }

  &-offset {
    border-radius: 0;
    box-shadow: 6px 6px 0 0 var(--btn-bg), inset 6px 6px 0 0 var(--btn-bg);
    transition: 0.3s;

    &:hover {
      background: transparent;
      box-shadow: 0 0 0 0 var(--btn-bg),
        inset 108px 72px 0 0 var(--btn-bg);
    }
  }

  &-flip-down {
    --flip-button-height: 40px;
    height: var(--flip-button-height);
    color: transparent;
    border: none;
    border-radius: 0;
    perspective: 500px;
    transition: 0.3s;

    &:hover {
      color: transparent;
      background: transparent;
    }

    .front,
    .back {
      position: absolute;
      top: 0;
      left: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 100%;
    }

    .front {
      background: var(--btn-bg);
      color: white;
      transition: 0.3s;
      transform-origin: center center calc(var(--flip-button-height) / -2);
    }

    .back {
      color: white;
      background: var(--btn-bg);
      transform: rotateX(88deg);
      transform-origin: center center calc(var(--flip-button-height) / -2);
      transition: 0.3s;
    }

    &:hover {
      .front {
        transform: rotateX(-90deg);
      }

      .back {
        transform: rotateX(0deg);
      }
    }
  }

  &-marquee {
    font-weight: 600;
    border: none;
    overflow: hidden;
    transition: 0.3s;

    &:hover {
      transform: scale(1.1);
    }

    span {
      display: block;
      padding: 0 20px;
      animation: move-left 2s linear infinite;

      &::after {
        position: absolute;
        content: attr(data-text);
        top: 0;
        left: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
      }
    }
  }

  &-cross {
    transform: rotate(0);
    overflow: hidden;
    transition: 0.3s;

    &::before,
    &::after {
      position: absolute;
      content: "";
      left: 0;
      z-index: -1;
      width: 100%;
      height: 50%;
      background: var(--btn-bg);
      transform: scaleX(0);
      transition: transform 0.5s;
    }

    &::before {
      top: 0;
      transform-origin: left;
    }

    &::after {
      top: 50%;
      transform-origin: right;
    }

    &:hover {
      background: transparent;

      &::before,
      &::after {
        transform: scaleX(1);
      }

      &::before {
        transform-origin: right;
      }

      &::after {
        transform-origin: left;
      }
    }
  }

  &-open-line {
    border: none;
    transition: 0.3s;

    &::before,
    &::after {
      position: absolute;
      content: "";
      left: 0;
      width: 100%;
      height: 1px;
      background: var(--btn-bg);
      opacity: 0;
      transform: scaleX(0);
      transition: 0.4s ease-in-out;
    }

    &::before {
      top: 0;
    }

    &::after {
      bottom: 0;
    }

    &:hover {
      letter-spacing: 5px;
      color: var(--btn-bg);
      background: transparent;

      &::before,
      &::after {
        opacity: 1;
        transform: scaleX(1.2);
      }
    }
  }
}

@keyframes jittery {
  5%,
  50% {
    transform: scale(1);
  }

  10% {
    transform: scale(0.9);
  }

  15% {
    transform: scale(1.15);
  }

  20% {
    transform: scale(1.15) rotate(-5deg);
  }

  25% {
    transform: scale(1.15) rotate(5deg);
  }

  30% {
    transform: scale(1.15) rotate(-3deg);
  }

  35% {
    transform: scale(1.15) rotate(2deg);
  }

  40% {
    transform: scale(1.15) rotate(0);
  }
}

@keyframes jelly {
  25% {
    transform: scale(0.9, 1.1);
  }

  50% {
    transform: scale(1.1, 0.9);
  }

  75% {
    transform: scale(0.95, 1.05);
  }
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 0 var(--btn-bg);
  }
}

@keyframes move-left {
  to {
    transform: translateX(-100%);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console