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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <button onclick="playAround()" style="font-family: cursive;" class="mb-4">Play around</button>

<form id="form" class="pb-4 gap-2 flex items-top">
  <div style="width: 450px;">
    <label for="text-input" class="block pb-4">
      Paste in some text, click a button, and open the console.
    </label>
    <input style="width: 450px;" placeholder="" value="Have some fun " id="text-input" />

  </div>
  <div>
    <label for="font-size-input" class="block pb-4">
      Font Size
    </label>
    <input type="number" min="16" value="48" id="font-size-input" />
  </div>
</form>

<h2 class="text-xl">Click to console.log</h2>

<div class="flex gap-2 py-4">
  <button onclick="cursive()" style="font-family: cursive;">Cursive</button>
  <button onclick="rainbow()" class="text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-yellow-300 to-pink-600">Rainbow</button>
  <button onclick="redHeart()">Red Heart <span class="text-red-500 text-xs">♥</span></button>
  <button onclick="console.clear()">Clear</button>
</div>
              
            
!

CSS

              
                button,
input {
  background: #161825;
  color: #d0d2e0;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  outline: none;
  border: 1px solid #2f3247;
  font-size: 1.4rem;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

input:focus,
button:hover,
button:focus {
  cursor: pointer;
  border: 1px solid #fcbf24;
}

a {
  text-decoration: underline;
}

.app {
  background: #1c1e2e;
  color: #d0d2e0;
}

              
            
!

JS

              
                const input = document.getElementById("text-input");
const fontSizeInput = document.getElementById("font-size-input");
console.colors.cursive = function (text) {
  return console.style.wrap(
    text,
    `font:normal normal bold ${fontSizeInput.value}px/normal cursive;`
  );
};
console.colors.rainbow = function (text) {
  return console.style.wrap(
    text,
    `box-sizing:content-box;font:normal normal bold ${fontSizeInput.value}px/normal cursive;color:transparent;text-align:center;text-shadow:3px 0 0 #d91f26,6px 0 0 #e25b0e,9px 0 0 #f5dd08,12px 0 0 #059444,15px 0 0 #0287ce,18px 0 0 #044d91,21px 0 0 #2a1571;transition:all 600ms cubic-bezier(.68,-.55,.265,1.55)`
  );
};
const clear = () => {
  console.clear();
};

const rainbow = () => {
  console.style(console.colors.rainbow(input.value) + "      ");
};

const cursive = () => {
  console.style(console.colors.cursive(input.value));
};

const redHeart = () => {
  const wrap = console.style.wrap;
  console.style(
    "Everyone " + wrap("♥", "color:#c00;font-weight:bold;") + " console.style"
  );
};

const playAround = () => {
  console.style(
    console.colors.cursive("Play around") + console.colors.rainbow(" ❤️   ")
  );
};

              
            
!
999px

Console