123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <nav>
  <a href="#" class="btn corner-1">Corner Scoop</a>
  <a href="#" class="btn corner-2">Corner Bevel</a>
  <a href="#" class="btn corner-3">Corner Notch</a>
</nav>
            
          
!
            
              /* =============================================================================
		Corner shaping mixin using stacked gradients
	========================================================================= */

@mixin corners($shape, $size, $color) {
 
  $n1: $size+px;
  $n2: ($size)*2+px;
  $n3: $size+1+px;
  $pn: 0%;
  @if ($size <= 10) { $pn: 6%; }
  @elseif ($size <= 15) { $pn: 5%; }
  @elseif ($size <= 20) { $pn: 4%; }
  @elseif ($size <= 40) { $pn: 3%; }
  @elseif ($size <= 50) { $pn: 2%; }
  @elseif ($size <= 60) { $pn: 1%; }
  $pd-scoop: 64%+$pn;
  
  @if ($shape == "bevel") {
    background: $color;
    background:
          linear-gradient(to right , $color 0, $color 100%) no-repeat top center,
          linear-gradient(to bottom, $color 0, $color 100%) no-repeat center left,
          linear-gradient(135deg,  transparent 49%, $color 50% ) no-repeat top left,
          linear-gradient(-135deg, transparent 47%, $color 48% ) no-repeat top right,
          linear-gradient(45deg,   transparent 47%, $color 48% ) no-repeat bottom left,
          linear-gradient(-45deg,  transparent 46%, $color 47% ) no-repeat bottom right;
    background-size: calc(100% - #{$n2}) 100%, 100% calc(100% - #{$n2}), $n3 $n3, $n3 $n3, $n3 $n3, $n3 $n3;
  }
  
  @if ($shape == "scoop") {
    $t-t: t t; // compiler bug hack
    $t-b: t b; // compiler bug hack
    background: $color;
    background:
          linear-gradient(to right , $color 0, $color 100%) no-repeat top center,
          linear-gradient(to bottom, $color 0, $color 100%) no-repeat center left,
          radial-gradient(a+$t-t+op left,     transparent 64%, $color $pd-scoop ) no-repeat top left,
          radial-gradient(a+$t-t+op right,    transparent 64%, $color $pd-scoop ) no-repeat top right,
          radial-gradient(a+$t-b+ottom left,  transparent 64%, $color $pd-scoop ) no-repeat bottom left,
          radial-gradient(a+$t-b+ottom right, transparent 64%, $color $pd-scoop ) no-repeat bottom right;
    background-size: calc(100% - #{$n2}) 100%, 100% calc(100% - #{$n2}), $n3 $n3, $n3 $n3, $n3 $n3, $n3 $n3;
  }
  
  @if ($shape == "notch") {
    background: $color;
    background:
          linear-gradient(to right , $color 0, $color 100%) no-repeat top center,
          linear-gradient(to bottom, $color 0, $color 100%) no-repeat center left;
    background-size: calc(100% - #{$n2}) 100%, 100% calc(100% - #{$n2});
  }
  
}

.corner-1 {
  transition: all 0.3s;
  @include corners('scoop', 10, #770000);
  &:after {
    transition: all 0.3s;
    @include corners('scoop', 10, #330000);
  }
  &:hover {
    @include corners('scoop', 27, #990000);
    &:after { @include corners('scoop', 27, #330000); }
  }
}

.corner-2 {
  transition: all 0.3s;
  @include corners('bevel', 16, #007700);
  &:after {
    transition: all 0.3s;
    @include corners('bevel', 16, #003300);
  }
  &:hover {
    @include corners('bevel', 40, #009900);
    &:after { @include corners('bevel', 40, #003300); }
  }
}

.corner-3 {
  transition: all 0.3s;
  @include corners('notch', 5, #0055cc);
  &:after {
    transition: all 0.3s;
    @include corners('notch', 5, #002266);
  }
  &:hover {
    @include corners('notch', 15, #0077ee);
    &:after { @include corners('notch', 15, #002266); }
  }
}

.btn {
  display: inline-block;
  padding: 20px 30px 16px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  color: #fff;
  text-decoration: none;
  position: relative;
  &:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 4px;
    left: 0;
    z-index: -1;
  }
}

nav {
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -40px;
  width: 100%;
  text-align: center;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console