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

              
                - arr = Array.from(Array(100).keys())

mixin svg
    svg(width="24" height="24" viewBox="0 0 24 24" fill="#000")
        path(d="M9.29289 18.7071C8.90237 18.3166 8.90237 17.6834 9.29289 17.2929L14.5858 12L9.29289 6.70711C8.90237 6.31658 8.90237 5.68342 9.29289 5.29289C9.68342 4.90237 10.3166 4.90237 10.7071 5.29289L16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L10.7071 18.7071C10.3166 19.0976 9.68342 19.0976 9.29289 18.7071Z")
        
header
    .holder
        h1#title My longer view title

main
    p.intro Currently this demo only works in Chrome Canary.
    ul
        each val in arr
            li
                div
                    h2 Item title
                    p My item meta
                +svg

              
            
!

CSS

              
                // Vars
$header-height: 90px;
$header-padding: 15px;


html, body {
    margin: 0;
    padding: 0;
}

main {
    padding: 90px 0 20px;
    height: calc(100% - $header-height);
}

.intro {
    background: #FFC;
    padding: 15px;
    text-align: center;
}

html {
    scroll-timeline: --title-scroller block;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

main li {
    padding: 15px;
    position: relative;
    z-index: -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    &:after {
        content: ' ';
        border-bottom: 1px solid #DDD;
        position: absolute;
        left: 15px;
        bottom: 0;
        width: 100%;
    }
}

li svg {
    opacity: .33;
}

li p {
    color: gray;
}

main h2 {
    font-weight: 600;
    margin-bottom: 4px;
}

header {
    padding: $header-padding;
    background: #FFF;
    height: $header-height - ($header-padding*2);
    border-bottom: 1px solid transparent;
    position: fixed;
    left: 0; right: 0;
    animation: bar auto linear;
    animation-timeline: --title-scroller;
    animation-range: 0 100px;
    animation-fill-mode: forwards;
}

header .holder {
    position: relative;
    width: 100%;
}

header h1 {
  font-weight: 600;
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  animation: grow auto linear;
  animation-timeline: --title-scroller;
  animation-range: 0 100px;
  animation-fill-mode: forwards;
  font-size: 46px;
}

@keyframes grow {
    to {
        left: 50%;
        translate: -25%;
        font-size: 20px;
    }
}

@keyframes bar {
    to {
        height: 24px;
        border-bottom-color: #DDD;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console