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


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


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.


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.


autor: Marco Barría

<div class="border__shadow">

<div class="border__shadow">

<div class="border__shadow">


                // var

$color-base: #2c3e50;
$color-border: #fff;

$w: 200px;
$h: 350px;

.border__shadow {
  background: $color-border;
  cursor: pointer;
  position: relative;
  margin: 2%;
  line-height: $h;
  text-align: center;
  width: $w;
  height: $h;
  overflow: hidden; // important
  transition: background 350ms 600ms ease-in-out;
  &:hover {
    background: $color-base;
    transition-delay: 0ms;
  &:hover > span {
    color: $color-border;
    transition-delay: 0ms;
  &::after {
    box-shadow: // top
                0 ((-$h)+2) 0 0.0619em $color-border,
                ($w)+2 ((-$h)+2) 0 0 transparent,
                $w*2 ((-$h)+2) 0  0 $color-border,
                // right
                (($w)-2) 0 0 0 $color-border,
                (($w)-2) $h 0 transparent,
                (($w)-2) $h*2 0 $color-border,
                // left
                ((-$w)+2) (-$h)*2 0 $color-border,
                ((-$w)+2) (-$h) 0 0 transparent,
                ((-$w)+2) 0 0 0 $color-border,
                // bottom
                (-$w)*2 (($h)-2) 0 0 $color-border,
                (-$w)*2 (($h)-2) 0 0 transparent,
                0 (($h)-2) 0 0.0619em $color-border;
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: ($w)-2;
    height: ($h)-2;
    transition: box-shadow 950ms ease-in-out;
  &:hover::after {
    box-shadow: // top
                (-$w)*2 ((-$h)+2) 0 0 $color-border,
                (-$w)*2 ((-$h)+2) 0 0 transparent,
                0 ((-$h)+2) 0 0.0619em $color-border,
                // right
                (($w)-2) (-$h)*2 0 $color-border,
                (($w)-2) (-$h) 0 transparent,
                (($w)-2) 0 0 $color-border,
                // left
                ((-$w)+2) 0 0 $color-border,
                ((-$w)+2) $h 0 transparent,
                ((-$w)+2) $h*2 0 $color-border,
                // bottom
                0 (($h)-2) 0 0.0619em $color-border,
                ($w)+2 (($h)-2) 0 0 transparent,
                $w*2 (($h)-2) 0 0 $color-border;
  &::before {
    border: 2px solid $color-base;
    content: "";
    position: absolute;
    top: 0px;
    left: 0px;
    width: ($w);
    height: ($h);
  > span {
    color: $color-base;
    font-weight: 500;
    letter-spacing: 4px;
    transition: color 350ms 600ms ease-in-out;


*:before {
    box-sizing: border-box;

body {
  width: 100%;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizelegibility;

body {
  background: $color-base;
  font-family: 'Roboto', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center; 



my own version.
Edges created with box-shadow and minimum possible elements. 
pure css.

based on:

of codrops.