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

              
                <html>
<head>
    <meta charset="utf-8">
    <title>JS Bin</title>
</head>
<body>
    <article>
        <main>
            <header>
                <h1>Example</h1>
            </header>
            <p>Content...</p>
        </main>
        <aside>Aside</aside>
    </article>
</body>
</html>
              
            
!

CSS

              
                grid-width ?= 500px
grid-columns ?= 6
grid-margins ?= 1
grid-margin ?= 15px
grid-gutter ?= 10px

grid-fn(columns, margins = 0)
    total-margins = grid-margin * (grid-columns - 1) * grid-margins
    total-gutter = grid-gutter * 2
    grid-column = (grid-width - total-gutter - total-margins) / grid-columns
    return grid-column * columns + margins * grid-margin + grid-margin * max(floor(columns - 1), 0) * grid-margins

grid(property, columns, margins = 0, attributes..., when = null, dim = 'width', breakpoint = null, breakpoint-cols = null, orientation = null)
    if margins == !important
        margins = 0
        attributes = !important

    if breakpoint-cols
            breakpoint = grid-fn(breakpoint-cols) + grid-gutter * 2

    if when == null || breakpoint == null
        {property} grid-fn(columns, margins) attributes
    else
        if when is 'above'
            prefix = 'min'
        else if when is 'below'
            prefix = 'max'
        else
            error('Invalid "above" value')

        if orientation
            @media ({prefix}-{dim}: breakpoint) and (orientation: orientation)
                {property} grid-fn(columns, margins) attributes
                {block}
        else
            @media ({prefix}-{dim}: breakpoint)
                {property} grid-fn(columns, margins) attributes
                {block}

$column-base
    padding 0
    margin-bottom grid-margin
    &:first-child
        margin-left 0
    &:last-child
        margin-right 0

for col in (1..grid-columns)
    $column{col}
        @extends $column-base
        float left
        grid width col
        margin-left (grid-margin / 2)
        margin-right (grid-margin / 2)
        for b-col in (grid-columns..1)
            new-cols = b-col - 1
            if b-col > col
                new-cols = col
            +grid(when:below, breakpoint-cols:b-col, width, new-cols)
                if new-cols <= col
                    margin-left 0
            
$columns-full
    @extends $column{grid-columns}

$columns-half
    @extends $column{grid-columns / 2}

$columns-two-thirds
    @extends $column{grid-columns * 2 / 3}
                
$columns-third
    @extends $column{grid-columns / 3}

// Example usage

article
    @extends $columns-full
    float none
    margin 0 auto !important
    // Clearfix
    zoom 1
    &:before, &:after
        content ''
        display table
    &:after
        clear both
      
main
    @extends $columns-two-thirds
        
aside
    @extends $columns-third
        
// Make-up
        
$shadow-spread = 0px
$shadow-blur = 3px
$shadow-shift = 2px
        
body *
    box-shadow 0px $shadow-shift $shadow-blur $shadow-spread rgba(black, 0.3)
    background #fff
 
              
            
!

JS

              
                
              
            
!
999px

Console