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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.sky
div.rick
  div.names
    div.name.r
    div.name.i
    div.name.c
    div.name.k
  div.backhairs
  div.hairs
  div.body
    div.belt
    div.pants
    div.shirtLeft
    div.shirtRight
    div.leftArm
    div.rightArm
    div.shoes
      div.leftShoe
      div.rightShoe
  div.head
    div.eyes
      div.right-eye
      div.left-eye
    div.mouth
      div.olip
        div.lip
        div.dribble
        div.dribble2
              
            
!

CSS

              
                body { margin: 0; }

$sky-color: #aa8eff;

.sky {
  position: fixed;
  background-color: $sky-color;
  width: 100vw;
  height: 100vh;
}

// Rick
$rick--width: 10rem;
$rick-head--height: 280px;
$rick-hair--height: 230px;
$rick-hair--width: 230px;
$rick-body--height: 10vh;
$rick-leg--height: 10vh;

// Colors 
$rick--border: #333f42;
$rick--skin: #DDD8D0;
$rick--hair: #b1daee;
$rick--shirt: #98D5D7;
$rick--belt: #352909;
$rick--pants: #7d6234;

.rick {
  position: relative;
  margin: 0 auto;
  padding-top: 25px;
  width: 800px;
  height: 800px;
  .head {
    position: absolute;
    left: 0;
    right: 20px;
    top: 230px;
    margin: auto;
    width: $rick--width;
    height: $rick-head--height;
    background-color: $rick--skin;
    border-radius: 200px;
    border-width: 2px;
    border-color: $rick--border;
    border-style: solid;
    &:after {
      content: '';
      position: absolute;
      background: #bae0f0;
      height: 10px;
      width: 100px;
      top: 45px;
      left: 30px;
      border: solid 2px #333f42;
      border-radius: 100px;
    }
    &:before {
      content: '';
      position: absolute;
      height: 40px;
      width: 25px;
      background: #ddd8d0;
      border: solid 2px #333f42;
      border-bottom-right-radius: 50px;
      border-top-right-radius: 50px;
      border-left: 0;
      right: -20px;
      top: 150px;
    }
    .eyes {
      position: absolute;
      top: 25%;
      left: 0px;
      width: 100%;
      height: 80px;
      .right-eye, .left-eye {
        position: relative;
        float: left;
        box-sizing: border-box;
        width: 80px;
        height: 80px;
        border-radius: 50%;
        border: 2px solid $rick--border;
        background-color: #fff;
        &:before {
          position: absolute;
          content: '';
          box-sizing: border-box;
          width: 76px;
          height: 40px;
          background: #ddd8d0;
          border-top-left-radius: 50px;
          border-top-right-radius: 50px;
          border-bottom: solid 2px $rick--border;
        }
        &:after {
          position: absolute;
          content: '';
          box-sizing: border-box;
          bottom: 25px;
          right: 50px;
          width: 6px;
          height: 6px;
          background: $rick--border;
          border-radius: 50%;
        }
      }
    }
    .mouth {
      position: absolute;
      left: 0;
      right: 0;
      margin: 0 auto;
      height: 20px;
      width: 80%;
      border: 2px solid $rick--border;
      border-radius: 50px;
      bottom: 50px;
      &:before {
        content: '';
        position: absolute;
        width: 80%;
        height: 30px;
        top: -5px;
        left: 50%;
        transform: translateX(-50%);
        background-color: $rick--skin;
      }
      .olip {
        position: relative;
        height: 40px;
        width: 80px;
        overflow: hidden;
        top: 5px;
        left: 20%;
        .lip {
          position: absolute;
          left: -60px;
          width: 200px;
          height: 100px;
          border-top-left-radius: 50%;
          border-top-right-radius: 50%;
          border-bottom: 0;
          border: solid 2px #333f42;
          z-index: 99;
        }
        .dribble {
          position: absolute;
          background: #d2edc9;
          width: 30px;
          height: 18px;
          border: solid 2px $rick--border;
          top: 0px;
          left: 30px;
          border-top-left-radius: 1px;
          border-top-right-radius: 8px;
          border-bottom-left-radius: 5px;
          border-bottom-right-radius: 10px;
        }
        .dribble2 {
          position: absolute;
          background: #d2edc9;
          width: 7.5px;
          height: 15px;
          border: solid 2px $rick--border;
          top: 19px;
          left: 30px;
          border-bottom-left-radius: 5px;
          border-bottom-right-radius: 10px;
          border-top: 0;
        }
      }
    }
  }
  .hairs, .backhairs {
    position: absolute;
    left: 0;
    right: 0;
    top: 188px;
    margin: auto;
    width: $rick-hair--width;
    height: $rick-hair--height;
    background-color: $rick--hair;
    &:before {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      width: 100%;
      height: 100%;
      transform: rotate(-60deg);
      background-color: $rick--hair;
    }
    &:after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      width: 100%;
      height: 100%;
      transform: rotate(-120deg);
      background-color: $rick--hair;
    }
  }
  .backhairs {
    width: $rick-hair--width + 3px;
    height: $rick-hair--height + 3px;
    border: 3px solid $rick--border;
    top: 180px;
    &:before, &:after {
      border: 3px solid $rick--border;
      width: $rick-hair--width + 3px;
      height: $rick-hair--height + 3px;
    }
  }
  .body {
    width: 100px;
    height: 200px;
    background-color: $rick--shirt;
    position: absolute;
    top: 480px;
    left: 0;
    right: 0;
    margin: 0 auto;
    .shirtLeft {
      width: 50px;
      height: 250px;
      position: absolute;
      left: -30px;
      background-color: #fff;
      border-top-left-radius: 50px;
      border-bottom-right-radius: 50px;
      box-shadow: 3px 3px 0 $rick--border;
      &:before {
        position: absolute;
        content: '';
        border-bottom-left-radius: 100%;
        border-left: 3px solid #666;
        top: 25px;
        right: 0;
        position: absolute;
        background-color: white;
        width: 10px;
        height: 40px;
      }
    }
    .shirtRight {
      width: 50px;
      height: 250px;
      position: absolute;
      right: -30px;
      background-color: #fff;
      border-top-right-radius: 50px;
      border-bottom-left-radius: 50px;
      box-shadow: 4px 0px 0 $rick--border;
      &:before {
        position: absolute;
        content: '';
        border-bottom-right-radius: 100%;
        border-right: 3px solid #666;
        top: 25px;
        left: 0;
        position: absolute;
        background-color: white;
        width: 10px;
        height: 40px;
      }
    }
    .leftArm {
      width: 25px;
      height: 180px;
      position: absolute;
      top: 15px;
      left: -40px;
      background-color: #fff;
      border-top-left-radius: 50px;
      box-shadow: 0px 1px 0px 3px $rick--border;
      &:after {
        position: absolute;
        content: '';
        bottom: -25px;
        left: -5px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 2px solid $rick--border;
        background-color: $rick--skin;
      }
    }
    .rightArm {
      width: 25px;
      height: 180px;
      position: absolute;
      top: 15px;
      right: -40px;
      background-color: #fff;
      border-top-right-radius: 50px;
      box-shadow: 1px -1px 0px 3px #333f42;
      &:after {
        position: absolute;
        content: '';
        bottom: -25px;
        right: -5px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 2px solid $rick--border;
        background-color: $rick--skin;
      }
    }
    .belt {
      position: absolute;
      width: 100px;
      height: 20px;
      background-color: $rick--belt;
      bottom: 0px;
      &:after {
        position: absolute;
        content: '';
        width: 20px;
        height: 20px;
        background-color: #FDD62F;
        left: 50%;
        transform: translateX(-50%);
      }
    }
    .pants {
      width: 100px;
      height: 40px;
      background-color: $rick--pants;
      position: absolute;
      bottom: -40px;
      box-shadow: -20px 8px 0 4px #333f42, 20px 6px 0 4px #333f42;
      &:after {
        position: absolute;
        content: '';
        width: 40px;
        height: 100px;
        background-color: $rick--pants;
        left: 0;
        bottom: -100px;
      }
      &:before {
        position: absolute;
        content: '';
        width: 40px;
        height: 100px;
        background-color: $rick--pants;
        right: 0;
        bottom: -100px;
      }
    }
  }
  .shoes {
    width: 190px;
    height: 80px;
    position: absolute;
    bottom: -200px;
    left: -45px;
    text-align: center;
    .leftShoe {
      position: relative;
      display: inline-block;
      margin-right: 7px;
      width: 80px;
      height: 40px;
      background-color: #444444;
      border-top-left-radius: 100%;
      border-top-right-radius: 10%;
      border-bottom-left-radius: 20%;
      border-bottom-right-radius: 10%;
      &:after {
        position: absolute;
        content: '';
        width: 40px;
        height: 15px;
        top: -12px;
        right: 0;
        background-color: #fff;
      }
      &:before {
        position: absolute;
        content: '';
        width: 80px;
        height: 3px;
        bottom: 0;
        left: 0;
        background-color: wheat;
      }
    }
    .rightShoe {
      position: relative;
      display: inline-block;
      width: 80px;
      height: 40px;
      margin-left: 7px;
      background-color: #444444;
      border-top-right-radius: 100%;
      border-top-left-radius: 10%;
      border-bottom-right-radius: 20%;
      border-bottom-left-radius: 10%;
      &:after {
        position: absolute;
        content: '';
        width: 40px;
        height: 15px;
        top: -12px;
        left: 0;
        background-color: #fff;
      }
      &:before {
        position: absolute;
        content: '';
        width: 80px;
        height: 3px;
        bottom: 0;
        left: 0;
        background-color: wheat;
      }
    }
  }
}

// name
.names {
  position: absolute;
  left: 25%;
  top: 10%;
}

.name {
  background: #111;
  display: inline-block;
  height: .5em;
  margin: 1em;
  text-indent: -9999em;
  width: .5em;
  &.r {
    box-shadow: -1em -1em  0 #111, -.5em -1em  0 #111, 0 -1em  0 #111, .5em -1em  0 #111,
                -1em -.5em 0 #111,                                                        1em -.5em 0 #111,
                -1em 0     0 #111, -.5em 0     0 #111,                 .5em 0     0 #111,
                -1em .5em  0 #111,                                                        1em .5em  0 #111,
                -1em 1em   0 #111,                                                        1em 1em   0 #111;
  }
  &.i {
    box-shadow: -1em -1em  0 #111, -.5em -1em  0 #111, 0 -1em  0 #111, .5em -1em  0 #111, 1em -1em  0 #111,
                                                       0 -.5em 0 #111,
                
                                                       0 .5em  0 #111,
                -1em 1em   0 #111, -.5em 1em   0 #111, 0 1em   0 #111, .5em 1em   0 #111, 1em 1em   0 #111;
  }
  &.c {
    background: transparent;
    box-shadow:                    -.5em -1em  0 #111, 0 -1em  0 #111, .5em -1em  0 #111, 1em -1em  0 #111,
                -1em -.5em 0 #111,
                -1em 0     0 #111,
                -1em .5em  0 #111,
                                   -.5em 1em   0 #111, 0 1em   0 #111, .5em 1em   0 #111, 1em 1em   0 #111;
  }
  &.k {
    box-shadow: -1em -1em  0 #111,                                                        1em -1em  0 #111,
                -1em -.5em 0 #111,                                     .5em -.5em 0 #111,
                -1em 0     0 #111, -.5em 0     0 #111,  
                -1em .5em  0 #111,                                     .5em .5em  0 #111,
                -1em 1em   0 #111,                                                        1em 1em   0 #111;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console