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.


                <p>I've placed controls before and after the progress clock so you can experiment with how the focus behaves when using the keyboard.</p>
<p><label for="clock-size">Clock size:</label><input type="range" min="8" max="48" value="16" id="clock-size" autofocus /><p>

<fieldset class="clock-frame">
  <legend>Sample Progress Clock</legend>
  <p class="zero-progress"><label><input type="radio" name="progress-clock" value="0" checked="checked" class="visually-hidden" />Clear</label></p>
  <div class="clock" data-segments="8">
    <input type="radio" name="progress-clock" value="8" id="segment-8" /><label for="segment-8">8/8</label>
    <input type="radio" name="progress-clock" value="7" id="segment-7" /><label for="segment-7">7/8</label>
    <input type="radio" name="progress-clock" value="6" id="segment-6" /><label for="segment-6">6/8</label>
    <input type="radio" name="progress-clock" value="5" id="segment-5" /><label for="segment-5">5/8</label>
    <input type="radio" name="progress-clock" value="4" id="segment-4" /><label for="segment-4">4/8</label>
    <input type="radio" name="progress-clock" value="3" id="segment-3" /><label for="segment-3">3/8</label>
    <input type="radio" name="progress-clock" value="2" id="segment-2" /><label for="segment-2">2/8</label>
    <input type="radio" name="progress-clock" value="1" id="segment-1" /><label for="segment-1">1/8</label>

<p><button id="set-clock">Display as Clock</button> <button id="set-track">Display as Track</button></p>


                .clock-frame {
  display: inline-flex;
  flex-direction: column;
  border-radius: 2%;
  position: relative;
  justify-content: center;
  width: fit-content;
  padding: 1em;
  gap: 1em;
.clock-frame legend {
  float: left;
  order: 3;
.clock {
  position: relative;
  background-color: darkcyan;
  width: 4em;
  height: 4em;
  overflow: hidden;
  border: medium solid #666;
  border-radius: 50%;
  margin: 0 auto;
.clock input {
  appearance: none;
  display: inline-block;
  box-sizing: border-box;
  font-size: inherit;
  margin: 0;
  width: 2em;
  height: 2em;
  background-color: #eee;
  border: 1px solid #ccc;
  cursor: pointer;
  position: absolute;
  left: 2em;
  bottom: 2em;
  top: auto;
  transform-origin: 0 2em;
.clock input:checked,
.clock input:checked ~ input {
  background-color: #222;
.clock:focus-within {
  border: medium solid blue;
  outline: medium solid rgb(112, 179, 255);
  outline-offset: 2px;
.clock input:focus {
  background-color: rgb(0, 119, 255);
.clock input:hover {
  background-color: violet;
.clock input:hover ~ input {
  background-color: violet;
.clock input:checked:hover,
.clock input:checked:hover ~ input,
.clock input:checked ~ input:hover,
.clock input:checked ~ input:hover ~ input,
.clock input:hover ~ input:checked,
.clock input:hover ~ input:checked ~ input {
  background-color: rebeccapurple;
.clock input[value="8"] {
  transform: rotate(-45deg) skewY(-45deg);
.clock input[value="7"] {
  transform: rotate(-90deg) skewY(-45deg);
.clock input[value="6"] {
  transform: rotate(-135deg) skewY(-45deg);
.clock input[value="5"] {
  transform: rotate(-180deg) skewY(-45deg);
.clock input[value="4"] {
  transform: rotate(-225deg) skewY(-45deg);
.clock input[value="3"] {
  transform: rotate(-270deg) skewY(-45deg);
.clock input[value="2"] {
  transform: rotate(-315deg) skewY(-45deg);
.clock input[value="1"] {
  transform: rotate(0deg) skewY(-45deg);
.zero-progress {
  text-align: right;
  margin: 0;
.zero-progress label {
  border: 1px solid black;
  width: auto;
  padding: 0.25em 0.5em;
  border-radius: 3px;
  margin-bottom: none;
  font-size: 1em;
.zero-progress label:focus-within {
  border: medium solid blue;
  outline: thin solid rgb(112, 179, 255);
  outline-offset: 2px;
.clock label,
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
.clock.track {
    width: auto;
    overflow: auto;
    margin: 0 0 0 auto;
    border-radius: 0;
    display: flex;
    flex-direction: row-reverse;
    gap: 0.25em;
.clock.track input {
    transform: none;
    position: static;


                const clockToggle = document.querySelector('#set-clock');
const trackToggle = document.querySelector('#set-track');
const clockSize = document.querySelector('#clock-size');

clockToggle.addEventListener('click', e => document.querySelector('.clock').classList.remove('track'));
trackToggle.addEventListener('click', e => document.querySelector('.clock').classList.add('track'));

clockSize.addEventListener('input', e => document.querySelector('.clock').style.fontSize = `${}px`);