Pen Settings

HTML

CSS

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

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

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.

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

              
                label(for="toggle")
input#toggle(type="checkbox")
- const text = 'Cool!'
.panels
  - let p = 0
  while p < 5
    .panel
      .panel__content
        span=text
    - p++
              
            
!

CSS

              
                *
  box-sizing border-box
  line-height 1

:root
  --hue 210

body
  min-height 100vh
  flex-direction column
  display flex
  align-items center
  justify-content center
  background 'hsl(%s, 80%, 95%)' % var(--hue)
  overflow hidden

label
  height 100vh
  width 100vw
  position fixed
  z-index 2

input
  height 0
  width 0
  position fixed
  left 100%
  opacity 0

:checked ~ .panels
  display block

:checked ~ .panels .panel
  overflow visible
  border 2px solid black

:checked ~ .panels .panel__content
  border 2px solid black
  transform translate3d(0, 0, 10px)

.panels
  display flex
  flex-direction column

.panel
  font-family sans-serif
  font-weight bold
  font-size 5vmin
  color hsl(0, 0% 15%)
  display inline-block
  background 'hsl(%s, 100%, %s)' % (var(--hue) calc(var(--lightness) * 1%))
  overflow hidden
  height 15vmin
  width 15vmin
  transform-style preserve-3d
  perspective 800px

  &__content
    height 100%
    width 100%
    display flex
    align-items center
    justify-content  center
    animation slide 2s calc(var(--delay) * 1s) infinite both linear

@keyframes slide
  from
    transform translate3d(0, -100%, 1px)
  to
    transform translate3d(0, 100%, 1px)

.panel:nth-of-type(1)
  --delay 0
  --lightness 80
  transform rotateX(32deg) rotateY(-32deg) rotateX(0deg) translate3d(-61%, 81%, 0)

.panel:nth-of-type(2)
  --delay -1
  --lightness 90
  transform rotateX(32deg) rotateY(-32deg) rotateX(-100deg) translate3d(-76%, 74%, 0)

.panel:nth-of-type(3)
  --delay -2
  --lightness 85
  transform rotateX(32deg) rotateY(-32deg)
.panel:nth-of-type(4)
  --delay -1
  --lightness 90
  transform rotateX(32deg) rotateY(-32deg) rotateX(-100deg) translate3d(76%, -74%, 0)
.panel:nth-of-type(5)
  --delay -2
  --lightness 80
  transform rotateX(32deg) rotateY(-32deg) rotateX(0deg) translate3d(61%, -81%, 0)
              
            
!

JS

              
                // Tap for a little perspective! 
              
            
!
999px

Console