css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <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>
            
          
!
            
              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
 
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console