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

              
                .container
  .header
  .body
    .walls
      .top
      .left
      .right
      .bottom
    .doors
      .left
      .right
              
            
!

CSS

              
                $width: 300px
$height: 180px

*
  box-sizing: border-box

.container
  margin: auto
  width: $width
  height: $height
  display: flex
  flex-direction: column
  align-items: center
  $header_height: 20%
  .header
    height: $header_height
    $color1: #F08300
    $color2: #009944
    $color3: #E60012
    background: linear-gradient(transparent 0%, $color1 5%, $color1 20%, transparent 25%, transparent 30%, $color2 35%, $color2 65%, transparent 70%, transparent 75%, $color3 80%, $color3 95%, transparent 100%)
    width: 100%
  .body
    height: 100% - $header_height
    width: 95%
    position: relative
    .walls
      width: 100%
      height: 100%
      > *
        position: absolute
        background: #666666
      .top, .bottom
        left: 0
        width: 100%
      .top
        top: 0
        height: 20%
      .bottom
        bottom: 0
        height: 1px
      .left, .right
        top: 0
        height: 100%
      .left
        left: 0
        width: 20%
      .right
        right: 0
        width: 40%
    .doors
      position: absolute
      bottom: 0
      width: 40%
      height: 80%
      left: 20%
      > *
        position: absolute
        width: 50%
        height: 100%
        background: rgba(skyblue, 0.5)
        border: #cccccc 5px solid
        transition: all 1.5s ease
      .left
        left: 0
      .right
        right: 0
      &:hover
        .left
          transform: translateX(-100%)
        .right
          transform: translateX(100%)
              
            
!

JS

              
                
              
            
!
999px

Console