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

              
                <div class="codepen">
  <div class="face front"></div>
  <div class="face back"></div>
  <div class="face top"></div>
  <div class="face bottom"></div>
  <div class="face left"></div>
  <div class="face right"></div>
</div>
              
            
!

CSS

              
                cWidth = 106px/1.3
cHeight = 66px/1.3
cBorder = 9px/1.3
cShadow = 7px/1.3
cRadius = 4px
cColorFg = #fff
cColorBg = #000
cRotateX = -43deg
cRotateY = -45deg
cDuration = 3s
cDelay = 2s
cTiming = ease-in-out

@keyframes cRotate
  0%
    transform rotateX(cRotateX) rotateY(cRotateY)
  40%
  60%
    transform rotateX(cRotateX) rotateY(cRotateY + 360deg)
  80%
  100%
    transform rotateX(cRotateX - 180deg) rotateY(cRotateY + 360deg)

*
  box-sizing border-box
body
  width 100vw
  height 100vh
  display flex
  align-items center
  justify-content center
  background-color cColorBg
.codepen
  position relative
  width cWidth
  height cHeight
  transform-style preserve-3d
  transform rotateX(cRotateX) rotateY(cRotateY)
  animation cRotate cDuration forwards cTiming infinite cDelay
.face
  position absolute
  width inherit
  height inherit
  border-radius cRadius
  border cBorder solid cColorFg
  box-shadow 0 0 0 cShadow cColorFg
  background-color transparent
  &.front
    transform translate3d(0, 0, cWidth/2)
  &.back
    transform rotateY(180deg) translate3d(0, 0, cWidth/2)
  &.left
    transform rotateY(-90deg) translate3d(0, 0, cWidth/2)
  &.right
    transform rotateY(90deg) translate3d(0, 0, cWidth/2)
  &.top
    width cWidth
    height cWidth
    transform rotateX(90deg) translate3d(0, 0, cWidth/2)
  &.bottom
    width cWidth
    height cWidth
    bottom 0
    transform: rotateX(-90deg) translate3d(0, 0, cWidth/2)
              
            
!

JS

              
                
              
            
!
999px

Console