Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                .wrapper
  .container
    each num in [1,2,3,4,5,6]
      button(class="btn--" + num) Button #{num}
              
            
!

CSS

              
                $blue: #259BB6;
$green: #9BBF40;
$purple: #915B9F;

@mixin size($width, $height: $width) {
	width: $width;
	height: $height;
}

@mixin absoluteCenter {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

@mixin light-button($accent) {
  border: 2px solid $accent;
  color: $accent;
  
  &:before {
    opacity: 0;
    background-color: $accent;
  }
  
  &:hover { color: white; }
}

@mixin dark-button($accent) {
  border: 2px solid $accent;
  color: white;
  
  &:before { background-color: $accent; }
  &:hover { color: $accent; }
}

html,body {
  @include size(100%);
  box-sizing: border-box;
  
  *, *:before, *:after {
    box-sizing: border-box;
  }
}
  
.wrapper {
  width: 504px;
  max-width: 100%;
  @include absoluteCenter;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, 236px);
  grid-gap: 16px 32px;
  justify-content: center;
}
  
.btn {
  @include size(100%, 48px);
  position: relative;
  overflow: hidden;
  font-size: 18px;
  background: transparent;
  cursor: pointer;
  &:focus { outline: none; }

  &:before {
    content: "";
    @include size(100%);
    @include absoluteCenter;
    z-index: -1;
  }

  &--1 {
    @extend .btn;
    @include light-button($blue);
    transition: color 0s linear 0.3s;

    &:before {
      @include size(0);
      opacity: 1;
      border-radius: 100%;
      transition: all 0.3s linear;
    }

    &:hover {
      transition-delay: 0s;
      &:before { @include size(250px); }
    }
  }

  &--2 {
    @extend .btn;
    @include dark-button($blue);
    transition: color 0s linear 0s;

    &:before {
      @include size(250px);
      @include absoluteCenter;
      border-radius: 100%;
      transition: all 0.3s linear;
    }

    &:hover {
      transition-delay: 0.3s;
      &:before { @include size(0); }
    }
  }

  &--3 {
    @extend .btn;
    @include light-button($green);
    transition: color 0.4s linear;

    &:before { transition: opacity 0.3s linear 0.1s; }
    &:hover:before { opacity: 1; }
  }

  &--4 {
    @extend .btn;
    @include dark-button($green);
    transition: color 0.3s linear 0.1s;

    &:before { transition: opacity 0.4s linear; }
    &:hover:before { opacity: 0; }
  }

  &--5 {
    @extend .btn;
    @include light-button($purple);
    transition: color 100ms linear;

    &:before {
      height: 0;
      opacity: 1;
      transition: height 200ms linear;
    }

    &:hover:before { height: 100%; }
  }

  &--6 {
    @extend .btn;
    @include dark-button($purple);
    transition: color 100ms linear;

    &:before { transition: height 200ms linear; }
    &:hover:before { height: 0; }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console