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

              
                %div.wrapper
  %div.bttn.out.cyan
    %span Infiniti
    %div.corners.top
    %div.corners.bottom

  %div.bttn.in
    %span Infinity
    %div.corners.top
    %div.corners.bottom

  %div.box.out
    %div.content
      %p Bacon ipsum dolor amet meatloaf corned beef frankfurter tongue
    %div.corners.top
    %div.corners.bottom
    
  %div.box.in
    %div.content
      %p Short ribs boudin cow landjaeger spare ribs cupim.
    %div.corners.top
    %div.corners.bottom
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Electrolize);

// settings
$text-color: #FFB902;
$line-color: #FFB902;
$line-size: 7;

html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }

// general
body {
  font-family: 'Electrolize', sans-serif;
  background: #070707;
  overflow: hidden;
}

// magic wrapper
.wrapper {
  // @include translateCenter;
  // text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  
  > div {
    margin: 20px;
  }
}

//
//  Corners mixin (MAGIC BE HERE!)
//
@mixin line-corners($line-color: cyan, $line-size: 7, $line-type: out, $line-distance: 20) {
  position: absolute;
  width: 100%;
  
  transition-duration: 0.3s;
  
  // arrows
  &:before,
  &:after {
    content: '';
    
    position: absolute;
    
    width: $line-size + px;
    height: $line-size + px;
    
    border-color: $line-color;
    border-style: solid;
    
    // will-change: transform, opacity;
    transition-duration: 0.3s;
    transform: translateZ(0);
  }
  
  // top corners
  &.top {
    &:before { border-width: 1px 0 0 1px; }
    &:after { border-width: 1px 1px 0 0; }
  }
  
  // bottom corners
  &.bottom {
    &:before { border-width: 0 0 1px 1px; }
    &:after { border-width: 0 1px 1px 0; }
  }
  
  @if $line-type == out {
    &:before { left: 0; }
    &:after { right: 0; }
    &.top { top: 0; }
    &.bottom { bottom: $line-size + px; }    
  }
  
  @if $line-type == in {
    &:before { left: $line-distance + px; }
    &:after { right: $line-distance + px; }
    &.top { top: $line-distance + px; }
    &.bottom { bottom: ($line-distance + $line-size) + px; }
  }
}

@mixin line-corners-hover($line-size: 7, $line-type: out, $line-distance: 20) {
  @if $line-type == out {
    &:before { left: 0; }
    &:after { right: 0; }
    &.top { top: 0; }
    &.bottom { bottom: $line-size + px; }
  }
  
  @if $line-type == in {
    &:before { left: $line-distance + px; }
    &:after { right: $line-distance + px; }
    &.top { top: $line-distance + px; }
    &.bottom { bottom: ($line-distance + $line-size) + px; }
  }
}

// style: borders out (edge)
@mixin line-corners-out($line-color: cyan, $line-size: 7) {
  .corners { @include line-corners($line-color, $line-size, out); }
  &:hover {
    .corners { @include line-corners-hover($line-size, in); }
  }
}
  
// style: borders in
@mixin line-corners-in($line-color: cyan, $line-size: 7) {
  .corners { @include line-corners($line-color, $line-size, in); }
  &:hover {
    .corners { @include line-corners-hover($line-size, out); }
  }
}
//
// @end: Corners mixin
//

//
// magic buttons
//
.bttn {
  display: inline-block;
  vertical-align: middle;
  position: relative;

  // text
  span {
    display: block;
    padding: 30px;
    
    font-size: 30px;
    color: $text-color;
    text-transform: uppercase;

    // transition: all 0.3s ease-out;
  }
  
  &:hover {
    cursor: pointer;
  }
  
  // include corners
  &.out {
    @include line-corners-out(cyan);
  }
  
  &.in {
    @include line-corners-in($line-color);
  }
}

.bttn {
  //opacity: 0;

  //will-change: transform, opacity;
  //animation: fadeIn 0.6s 0.5s forwards ease-out;
  
  // cyan theme
  &.cyan {
    $theme-color: cyan;
    span { color: $theme-color; }
    .corners {
      &:after,
      &:before { border-color: $theme-color; }
    }
  }
}

//
//  magic box
//
.box {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  
  width: 200px;
  
  .content {
    margin: 20px;
    padding: 20px;
    
    border: 1px dashed transparent;
    color: white;

    font-size: 14px;
    line-height: 1.3;
  }
  
  // include corners
  &.out {
    @include line-corners-out(cyan);
    .content {
      border-color: rgba(0, 255, 255, 0.5);
      color: cyan;
    }
  }
  
  &.in {
    @include line-corners-in($line-color);
    .content {
      border-color: rgba(255, 185, 2, 0.5);
      color: $text-color;
    }
  }
}

//
//  Animations
//
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(50%);
  }
  
  to {
    opacity: 1;
    transform: translateY(0%);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console