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

              
                <h1><span class="the-s">S</span>CSS</h1>
<div class="rule-set">
  <div class="parent"><span>.some-class </span><span class="open-bracket">{</span></div>
  <div class="child"><span class="ampersand fade-out">&</span>.another-class { }</div>
  <div class="close-bracket">}</div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:900);
$medium: 600px;
body {
  font-size: 30px;
  font-family: 'Source Code Pro';
  @media all and (max-width: $medium) {
    font-size: 16px;
  }
}
h1 {
  color: #1F8DBD;
  font-size: 40px;
  text-align: center;
  margin: 50px 0;
}
.rule-set {
  width: 400px;
  margin: 0 auto;
  @media all and (max-width: $medium) {
    width:300px;
  overflow: hidden;
  }
}
.child {
  margin-left: 20px;
}
.parent,
.open-bracket,
.close-bracket {
  display: inline-block;
}

.the-s {
  animation: fade-out 3s ease-in-out both alternate infinite;
}
.open-bracket {
  animation: bracket-open 3s ease-in-out both alternate infinite;
}
.close-bracket {
  animation: bracket-close 3s ease-in-out both alternate infinite;
}
.fade-out {
  animation: fade-out 3s ease-in-out both alternate infinite;
}
.parent {
  animation: replace-ampersand 3s ease-in both alternate infinite;
    @media all and (max-width: $medium) {
    animation: replace-ampersand-small 3s ease-in both alternate infinite;
  }
}
.child {
  animation: child-slide-over 3s ease-in both alternate infinite;
    @media all and (max-width: $medium) {
    animation: child-slide-over-small 3s ease-in both alternate infinite;
  }

}
@keyframes child-slide-over {
  0% { transform: translateX(0); }
  30% { transform: translateX(0); }
  70% { transform: translateX(25%);}
  100% { transform: translateX(25%);}
}
@keyframes child-slide-over-small {
  0% { transform: translateX(0); }
  30% { transform: translateX(0); }
  70% { transform: translateX(27%);}
  100% { transform: translateX(27%);}
}
@keyframes replace-ampersand {
  0% { transform: translate(0, 0); }
  30% { transform: translate(0, 0); }
  70% { transform: translate(-29%, 101.5%);}
  100% { transform: translate(-29%, 101.5%);}
}
@keyframes replace-ampersand-small {
  0% { transform: translate(0, 0); }
  30% { transform: translate(0, 0); }
  70% { transform: translate(0%, 101.5%);}
  100% { transform: translate(0%, 101.5%);}
}
@keyframes fade-out {
  0% { opacity: 1; }
  30% { opacity: 1; }
  70% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes bracket-open {
  0% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
  30% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
  70% {
    transform: translateX(200px) rotate(200deg);
    opacity: 0;
  }
  100% {
    transform: translateX(200px) rotate(200deg);
    opacity: 0;
  }
}
@keyframes bracket-close {
  0% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
  30% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
  70% {
    transform: translateX(-200px) rotate(-210deg);
    opacity: 0;
  }
  100% {
    transform: translateX(-200px) rotate(-210deg);
    opacity: 0;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console