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

              
                <div class="parent">
  <button class="action-btn">
    <selectedoption id="pull-request-btn"></selectedoption>
  </button>
  <select selectedoptionelement="pull-request-btn">
    <button class="open-list-btn">
      <span class="arrow">
        <figure>↓</figure> <!-- should be image, using this for demo shortcut only -->
      </span>
    </button>
    <option value="merge-commit">
      <span class="preview-heading">Create a merge commit</span>
      <span class="action-heading">Merge Pull Request</span>
      <span class="description">All commits from this branch will be added to the base branch via a merge commit.</span>
    </option>
    <option value="squash-merge">
      <span class="preview-heading">Squash and merge</span>
      <span class="action-heading">Squash and merge</span>
      <span class="description">The 1 commit from this branch will be added to the base branch.</span>
    </option>
    <option value="rebase-merge">
      <span class="preview-heading">Rebase and merge</span>
      <span class="action-heading">Rebase and merge</span>
      <span class="description">The 1 commit from this branch will be rebased and added to the base branch.</span>
    </option>
  </select>
</div>
              
            
!

CSS

              
                select,
::picker(select) {
  appearance: base-select;
}

option,
button {
  font-family: system-ui;
  font-size: 1rem;
  padding: 1rem 1.5rem 1rem 2rem;
}

button {
  color: white;
  border: 1px solid #207a39;
  margin-bottom: 0.25rem;
  
  &:hover {
    background-color: #1a7f37;
    cursor: pointer;
  }
}

span {
  display: block;
  text-align: left;
}

.action-btn {
  background-color: #20883d;
  border-radius: 0.5rem 0 0 0.5rem;
  anchor-name: --pull-request-btn;
}

.open-list-btn {
  background-color: #1a7f37;
  border-radius: 0 0.5rem 0.5rem 0;
  
  &:hover,
  &:focus {
    background-color: #197935;
  }
}

::picker(select) {
  max-width: 350px;
  border-radius: 0.5rem;
  border: 1px solid lightgray;
  box-shadow: none;
  padding: 0;
  position-anchor: --pull-request-btn;
  position-area: bottom span-right;
}

option {
  white-space: unset; /* hmm.. why I need to do this? */
  line-height: 1.4;

  &:hover,
  &:focus {
    color: white;
    background-color: #0969da;
    cursor: pointer;
    & span {
      color: white;
    }
  }

  /*  Remove ::before checkmark spacing unless I want it there  */
  &::before {
    display: none;
  }
  
  &:checked::before {
    content: '✓';
    display: block;
    font-weight: 700;
    position: absolute;
    left: 0.75rem;
  }
}

.preview-heading,
.action-heading {
  font-weight: 600;
}

.description {
  font-size: 85%;
  color: gray;
}

option:not(:last-child) {
  border-bottom: 1px solid lightgray;
}

/* Swap headings */
option .action-heading {
  display: none;
}

selectedoption .description,
selectedoption .preview-heading {
  display: none;
}

.parent {
  display: grid;
  grid-template-columns: 220px auto;
}


body {
  padding: 2rem;
}

              
            
!

JS

              
                
              
            
!
999px

Console