Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                .iphone
  .screen
    .send.message
      | Hey, what's up?
    .receive.message
      | nm, I'm growing back my mustache and admiring myself in the mirror.
    .send.message
      | That's really weird, you should probably go outside.
    .receive.message
      | Good idea, other people need to admire my mustache, ttyl.
              
            
!

CSS

              
                // Variables

$background = #fff
$gray = #dedede
$blue = #2d8cfa

.iphone
    background #aaa
    border-radius 40px
    font-family Helvetica, Arial, sans-serif
    font-size 14px
    font-weight 100
    height 620px
    margin auto
    max-width 320px
    padding 80px 15px
    position relative

    &:before
        background rgba(0, 0, 0, 0.35)
        border-radius 4px
        content " "
        height 8px
        left 50%
        margin-left -30px
        position absolute
        top 45px
        width 60px
        z-index 99

    &:after
        background rgba(0, 0, 0, 0.35)
        border 4px solid rgba(255, 255, 255, 0.6)
        border-radius 50%
        bottom 11px
        content " "
        height 50px
        left 50%
        margin-left -29px
        position absolute
        width 50px
        z-index 99

.screen
    background $background
    border-radius 2px
    height 100%
    overflow auto
    padding 20px
    position relative
    z-index 1

    &:after
        clear both
        content " "
        display table

.message
    border-radius 20px
    clear both
    margin 5px 0
    max-width 80%
    padding 10px 15px
    position relative

    &:after
        border-radius 50%
        bottom 0
        content " "
        height 30px
        position absolute
        width 30px
        z-index -1

.receive
    background $gray
    float left

    &:after
        box-shadow inset 1px 9px 0 4px $background, inset -9px 0px 0 2px $gray, 0 0 0 1px $background
        left -19px

.send
    background $blue
    color #fff
    float right

    &:after
        box-shadow inset -1px 9px 0 4px $background, inset 9px 1px 0 2px $blue, 0 0 0 1px $background
        right -19px

*
    box-sizing border-box
              
            
!

JS

              
                
              
            
!
999px

Console