Pen Settings



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


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


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.


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.


                <button>Apply changes</button>



*::after {
  box-sizing: border-box;
  font-family: sans-serif;

 * Unperformant ugly color shift just to demonstrate
 * it works with all backgrounds.
@keyframes colorShift {
  0% {
    background-color: #ee9ca7;
  25% {
    background-color: #ffdde1;
  50% {
    background-color: #6dd5fa;
  75% {
    background-color: #fdc830;
  100% {
    background-color: #f37335;

body {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-height: 100vh;
  max-width: 20rem;
  animation: colorShift 10s infinite both alternate;

button {
  --triangle-offset-top: -6px;
  --triangle-offset-left: 1rem;
  position: relative;
  appearance: none;
  border: 0;
  color: #f8f9fa;
  background-color: transparent;
  padding: 1em 1.5em;
  font-size: inherit;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;

button:hover {
  --triangle-offset-top: -10px;

button:focus {
  outline: none;

button:focus::before {
  box-shadow: inset 0 0 0 2px #ff00b4;

 * The button background. We need it to be a separate element
 * since we only want to mask the background, not the contents
 * or the other triangle.
button::before {
  content: " ";
  background-color: #212529;
  background: linear-gradient(to bottom, #232526, #414345);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
    -webkit-linear-gradient(black, black),
    url('data:image/svg+xml;utf8,<svg xmlns="" width="22" height="18" viewBox="0 0 22 18"><polygon points="0 0 11 18 22 0 0 0"/></svg>');
    100% 100%,
    22px 18px;
    top left,
    var(--triangle-offset-left) var(--triangle-offset-top);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: exclude;
  -webkit-mask-composite: xor;
  transition: all 0.2s;
  border-radius: 3px;

 * The pink triangle
button::after {
  content: " ";
  display: block;
  width: 22px;
  height: 18px;
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(var(--triangle-offset-left), var(--triangle-offset-top));
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="" viewBox="0 0 22 18"><polygon points="3.57 2 11 14.16 18.43 2 3.57 2" fill="%23ff00b4"/></svg>');
  background-position: top left;
  background-size: 100% 100%;
  z-index: 1;
  transition: all 0.2s;