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

              
                    <div class="podcast">
      <div class="podcast__cover">
        <img
          class=""
          src="https://codepen.davidroessli.com/img/podcast-cover.png"
          alt="Compressed.fm cover art"
        />
      </div>
      <div class="podcast__content">
        <p class="podcast__content--title">
          Listen to all the Compressed.fm episodes
        </p>
        <ul class="podcast__content--playlist podcast__playlist" role="list">
          <li class="podcast__playlist--episodes">
            <label class="form-control">
              <input type="checkbox" name="checkbox" checked />
              <span class="input--label">1 || Trailer</span>
            </label>
          </li>
          <li class="podcast__playlist--episodes">
            <label class="form-control">
              <input type="checkbox" name="checkbox" />
              <span class="input--label">2 || James Q Quick Origin Story</span>
            </label>
          </li>
          <li class="podcast__playlist--episodes">
            <label class="form-control">
              <input type="checkbox" name="checkbox" />
              <span class="input--label">3 || Amy Dutton’s Origin Story</span>
            </label>
          </li>
          <li class="podcast__playlist--episodes">
            <label class="form-control">
              <input type="checkbox" name="checkbox" />
              <span class="input--label">4 || Tech Behind the Podcast</span>
            </label>
          </li>
          <li class="podcast__playlist--episodes">
            <label class="form-control">
              <input type="checkbox" name="checkbox" />
              <span class="input--label">5 || Tech Behind SelfTeach.me</span>
            </label>
          </li>
          <li class="podcast__playlist--episodes">
            <label class="form-control">
              <input type="checkbox" name="checkbox" />
              <span class="input--label">6 || Freelancing (Part 1)</span>
            </label>
          </li>
        </ul>
      </div>
    </div>

              
            
!

CSS

              
                /* Credits to @5t3ph https://moderncss.dev/pure-css-custom-checkbox-style/ */
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@100;400;900&display=swap");

:root {
  --background-color: #f3f3f3;
  --playlist-background-color: white;
  --title-color: #a7a7a7;
  --text-color: #4e4e4e;
  --text-color-completed: #c9cdd1;

  --font-size: 24px;
  --input-tick-color: #757575;
  --playlist-indent: 25px;
  --cover-max-width: 585px;
}
body {
  background-color: var(--background-color);
  font-family: "Nunito Sans", sans-serif;
  font-size: var(--font-size);
  line-height: 32.74px; /* 1.3641666667 */
  font-weight: 100;
  color: var(--text-color);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.podcast {
  padding: var(--playlist-indent);
  display: flex;
  flex-direction: column;
}
.podcast__cover {
  filter: drop-shadow(0px 5.40459px 32.4276px #453f3f);
}
.podcast__cover img {
  max-width: 100%;
}
.podcast__content {
  background-color: var(--playlist-background-color);
  margin: calc(var(--playlist-indent) * -2) var(--playlist-indent) 0
    var(--playlist-indent);
  padding: 60px;
  padding-top: calc(60px + var(--playlist-indent));

  box-shadow: 0px 4px 20px #e8eaef;
  border-radius: 32px;
  max-width: calc(var(--cover-max-width) - (2 * var(--playlist-indent)));
  overflow-y: scroll;
}
.podcast__content--title {
  color: var(--title-color);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.podcast__content--playlist {
}
.podcast__playlist--episodes:not(:last-of-type) {
  margin-bottom: var(--font-size);
}

.form-control {
  line-height: 1.1;
  display: grid;
  grid-template-columns: 1em auto;
  gap: 0.5em;
}

input[type="checkbox"] {
  /* Add if not using autoprefixer */
  -webkit-appearance: none;
  appearance: none;
  /* For iOS < 15 to remove gradient background */
  background-color: #fff;
  /* Not removed via appearance */
  margin: 0;

  font: inherit;
  color: var(--text-color);
  width: 1.25em;
  height: 1.25em;
  border: 0.1em solid currentColor;
  border-radius: 0.25em;
  transform: translateY(-0.075em);

  display: grid;
  place-content: center;
}

input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--form-control-color);
  /* Windows High Contrast Mode */
  background-color: var(--input-tick-color);
  transform-origin: bottom left;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus {
  outline: max(2px, 0.15em) solid currentColor;
  outline-offset: max(2px, 0.15em);
}

.input--label {
  padding-left: calc(var(--font-size) / 2);
}

.form-control + .form-control {
  margin-top: 1em;
}

@media screen and (min-width: 768px) {
  .podcast {
    flex-direction: row;
  }
  .podcast__content {
    box-shadow: 0px 4px 20px #e8eaef;
    margin: var(--playlist-indent) 0 calc(var(--playlist-indent) + 5.40459px)
      calc(var(--playlist-indent) * -1);
    max-width: none;
    padding-left: calc(60px + var(--playlist-indent));
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console