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

              
                .container
  .card(style="--cards:5")
    .child
      h2 Why do I need a will
      p 5 articles
    .child
    .child
    .child
    .child
  .card(style="--cards:3")
    .child
      h2 How to choose who inherits your estate
      p 3 articles
    .child
    .child
  .card(style="--cards:2")
    .child
      h2 What happens when you die
      p 2 articles
    .child
  .card(style="--cards:4")
    .child
      h2 How to choose guardians
      p 4 articles
    .child
    .child
    .child
  .card(style="--cards:4")
    .child
      h2 Why you've been disinherited
      p 4 articles
    .child
    .child
    .child
  .card(style="--cards:3")
    .child
      h2 How to commit fraud, legally
      p 3 articles
    .child
    .child
  .card(style="--cards:5")
    .child
      h2 Stay together for the kids
      p 5 articles
    .child
    .child
    .child
  .card(style="--cards:3")
    .child
      h2 Picking music for your funeral
      p 3 articles
    .child
    .child
              
            
!

CSS

              
                $bg: #F9F9F9
$card: #fff
@import url('https://fonts.googleapis.com/css?family=Arbutus+Slab|Open+Sans&display=swap')

body
  background: $bg
  color: #495456
  margin: 72px
  font-family: Open Sans, sans-serif

h2
  font-family: Arbutus Slab, serif
  font-weight: normal
  color: #000
  line-height: 1.25

p
  position: absolute
  bottom: 0
  font-size: 14px

.container
  max-width: 900px
  display: grid
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr))
  grid-gap: 48px
  margin: 0 auto
 
.card
  cursor: pointer
  position: relative
  height: 0
  padding-bottom: 120%
  --offset-multiplier: 4px
  &:hover
    --offset-multiplier: 6px
  transition: transform 0.6s ease
  --translate: 0
  transform: translate(var(--translate), var(--translate))
  &:hover
    --translate: calc(-1px * (var(--cards) - 1))
    transition: transform 0.3s ease

.child
  position: absolute
  width: 100%
  height: 100%
  padding: 0 16px
  box-sizing: border-box
  background: $card
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1), 0px -4px 8px rgba(255, 255, 255, 0.8)
  border-radius: 6px
  transition: inherit
  --translate: calc(var(--offset) * var(--offset-multiplier))
  transform: translate(var(--translate), var(--translate))
  z-index: 5

  @for $i from 1 through 5
    &:nth-child(#{$i})
      --offset: #{-1+$i}
      z-index: #{5 - $i}
  
              
            
!

JS

              
                
              
            
!
999px

Console