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

              
                .scene
 h1.title1 Where is My Cake!!
 .person
  .message Ohh... I didn't eat it
  .hairs
   .hair1
   .hair2
   .hair3
  .body
   .eyes
    .eye
     .eyeball
    .eye
     .eyeball
   .mouth
    .food
              
            
!

CSS

              
                $colorBlue: #307BE1
$colorDeepBlue: #2F4A6E
$colorYellow: #FFC12C
$colorOrange: #F38A0C
$colorRed: #FF5552
$colorShadow: rgba(black,0.1)
$shadowInset: inset -10px -10px 0px $colorShadow

@mixin size($w, $h: $w)
 width: $w
 height: $h

@mixin flexCenter()
 display: flex
 justify-content: center
 align-items: center
 
@mixin bdrsRect($w, $h, $r: $h/2)
 width: $w
 height: $h
 border-radius: $r
 
@mixin hair($w, $h)
 +bdrsRect($w, $h)
 background: #fff
 box-shadow: $shadowInset

html, body
 +size(100%)
 +flexCenter
 margin: 0
 
.scene
 +size(600px, 500px)
 +flexCenter
 position: relative
 background: $colorBlue
 .title1
  position: absolute
  left: 20px
  top: 20px
  color: #fff
  margin: 0
  opacity: 0
 .person
  position: relative
  .message
   position: absolute
   left: -200px
   top: 50px
   color: #fff
   margin: 0
   opacity: 0
  .hairs
   position: relative
   .hair1
    +hair(150px, 80px)
    margin-left: 10px
   .hair2
    +hair(150px, 60px)
    margin: 
     left: 50px
     top: -40px
   .hair3
    +hair(150px, 70px)
    margin:
     left: 5px
     top: -45px
 .body 
  +bdrsRect(210px, 120px, 40px)
  box-shadow: $shadowInset
  padding-top: 50px
  margin-top: -40px
  background: $colorYellow
  .eyes
   .eye
    +bdrsRect(50px, 25px)
    display: inline-block
    margin-left: 5px
    margin-right: 15px
    background-color: #fff
    .eyeball
     +bdrsRect(25px, 25px)
     background-color: $colorDeepBlue
 .mouth
  +bdrsRect(70px, 25px)
  margin: 
   left: 70px
   top: 15px
  background-color: $colorOrange
  .food
   +bdrsRect(12px, 12px)
   margin-left: -40px
   background-color: $colorOrange
   
.scene:hover
 .title1
  opacity: 1
 .person
  margin-top: 50px
  .message
   opacity: 1
  .body
   box-shadow: $shadowInset, 30px 10px $colorShadow
  .hairs
   .hair3
    margin-left: 0px
  &:hover
   transform: translateX(40px)
   .body
    box-shadow: $shadowInset, -30px 10px $colorShadow
    background-color: $colorRed
    .mouth
     transform: translateX(25px)
    .eye
     transform: translateX(30px)
     .eyeball
      transform: translateX(25px)
     
.scene:active
 .person
  transform: scale(0.9)
.scene
 .message
  transition-delay: 0.5s
 .body
  transition: 0.5s, background-color 4s 1s
 *
  transition: 0.5s
              
            
!

JS

              
                
              
            
!
999px

Console