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.


                <h1 class="title">scrollbar-gutter</h1>

<div class="actions">
  <button class="btn" id="addContent">Add content</button>
  <button class="btn btn--gutter" id="addGutter">Add gutter</button>
  <button class="btn" id="reset">Reset</button>

<p class="info-wrapper"><span class="info">16px padding</span> <span class="info info--gutter">Gutter</span></p>

<div class="box">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquam, asperiores tempore debitis sunt porro.</p>
  <p class="p-2 hidden">ipsum dolor sit amet consectetur adipisicing elit. Aliquam, asperiores tempore debitis sunt porro.</p>


                .box {
  --padding: 1rem;
  position: relative;
  max-width: 300px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-gutter: var(--gutter, auto);
  margin: 1rem auto 0;
  background: linear-gradient(
    to right,
    #fff calc(100% - 15px),
    #d98daf 0,
    #d98daf 15px
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: var(--padding);

  &:after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: 16px solid #d2e7c9;

p {
  margin-bottom: 1rem;

p.hidden {
  display: none;

.actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;

.btn {
  appearnce: none;
  border: 0;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid grey;
  border-radius: 100px;
  cursor: pointer;
} {
  color: #fff;
  background-color: #000;
  border-color: #000;
} {
  color: #fff;
  background-color: #db498a;
  border-color: #db498a;

.info-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin: 2rem auto 0;

.title {
  font-size: 1.5rem;
  text-align: center;
  font-family: monospace;
  font-weight: bolder;
  margin-bottom: 1rem;

.info {
  font-size: 0.85rem;

  &:before {
    content: "";
    display: inline-block;
    vertical-align: middle;
    width: 1.25em;
    height: 1.25em;
    background-color: #d2e7c9;
    border-radius: 2px;
    margin-right: 0.5em;
    border: 2px solid rgba(#000, 0.05);

.info--gutter {
  &:before {
    background-color: #d98daf;

*:after {
  box-sizing: border-box;

body {
  font-family: "Arial";
  color: #222;
  background-color: #f4f4f4;
  line-height: 1.35;
  padding: 2rem;



                let addContent = document.querySelector("#addContent");
let addGutter = document.querySelector("#addGutter");
let reset = document.querySelector("#reset");
let content = document.querySelector(".p-2");
let wrapper = document.querySelector(".box");

addContent.addEventListener("click", function () {

addGutter.addEventListener("click", function () {"--gutter", "stable");

   * This is a hack/workaround
   * See the bug for details:
   * Updated, it's fixed in Chrome Canary.


reset.addEventListener("click", function () {
  wrapper.setAttribute("style", "");

function resetOverflow() {
  var timer = setTimeout(function () { = "visible";

    var timer2 = setTimeout(function () { = "auto";
    }, 10);
  }, 30);