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

              
                - (1..28).each do |i|
  %cube
    - (1..6).each do |j|
      %face
              
            
!

CSS

              
                //different easings and rotations create some funky results
global-x = -90deg
easing = cubic-bezier(.5,-1,.25,-1)

html
body
  height 100%
  overflow hidden

body
  font-size calc(0.5vh + 0.7vw)
  background #EEE
  color white

@keyframes spin
  50%
    transform rotateX(global-x) rotateY(225deg)
  100%
    transform rotateX(global-x) rotateY(0) rotateZ(90deg)
  
cube
  display block
  position absolute
  top 0
  left 0
  right 0
  bottom 0
  margin auto
  width 1em
  height 1em
  transform-style preserve-3d
  transform rotateX(global-x) rotateY(45deg)
  animation spin 7.5s easing infinite
  
  for num in (1..28)
    &:nth-child({num})
      animation-delay num*0.06s
      font-size num*1em
  
face
  display block
  position absolute
  box-sizing border-box
  height 100%
  width 100%
  background rgba(30, 32, 40, 0.08)
  border 0.1em dotted
  border-radius:0.05em;
   
  &:nth-child(1)//bottom
    transform rotateX(270deg) translateZ(0.5em)
  &:nth-child(2)//sides
    transform rotateY(0) translateZ(0.5em)
  &:nth-child(3)
    transform rotateY(90deg) translateZ(0.5em)
  &:nth-child(4)
    transform rotateY(180deg) translateZ(0.5em)
  &:nth-child(5)
    transform rotateY(270deg) translateZ(0.5em)
  &:nth-child(6)//top
    transform rotateX(90deg) translateZ(0.5em)
  
              
            
!

JS

              
                
              
            
!
999px

Console