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

              
                <a class="css-tricks" href="https://twitter.com/bourhaouta" target="_blank">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</a>
              
            
!

CSS

              
                animation($name)
  animation: $name 2.5s cubic-bezier(0.5, 0, 0.5, 1) infinite

body
  overflow: hidden
  background-image: linear-gradient(90deg, #ff8a00, #e52e71)
  background-size: 400% 400%
  animation: background

body, .css-tricks
  display: flex
  align-items: center
  justify-content: center
  min-height: 100vh

.css-tricks
  transition: 0.35s transform ease
  animation: spin

  div, &::before
    transition: 0.25s opacity ease

  &:hover
    div, &::before
      opacity: 0.8

  &::before
    content: ''
    background-color: #fff
    border-radius: 50%
    width: 90px
    height: @width

  div
    position: absolute
    perspective: 500px

    &::before
      content: ''
      display: block
      transform: rotateX(-70deg)
      transform-origin: top center
      width: 80px
      height: 380px
      background-color: #fff
      border-radius: 40px 40px 0 0 / 60px 60px 0 0
      animation: shrink

    &:not(:nth-child(3n + 1))::before
      zoom: 1.05

for $n in (1 .. 5)
  div:nth-child({$n + 1})
    transform: rotate($n * 60deg)

@keyframes background
  0%
    background-position: 0% 50%

  50%
    background-position: 100% 50%

  100%
    background-position: 0% 50%

@keyframes spin
  0%
    transform: rotate(0) scale(1)

  50%
    transform: rotate(360deg) scale(0.4)

  100%
    transform: rotate(720deg) scale(1)

@keyframes shrink
  100%, 0%
    height: 380px
    width: 80px

  40%
    height: 0

              
            
!

JS

              
                
              
            
!
999px

Console