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 id="wrapper">
  <div class="flexDiv">
    <input type="checkbox" id="work-box" checked />
    <label for="work-box">
      <div class="tag work pos-abs">Work</div>
    </label>
    <input type="checkbox" id="personal-box" checked />
    <label for="personal-box">
      <div class="tag personal pos-abs">Personal</div>
    </label>
    <input type="checkbox" id="read-box" checked />
    <label for="read-box">
      <div class="tag read pos-abs">Read</div>
    </label>

    <div class="note">
      Fix the icons in the Design System
      <div class="tag work">Work</div>
    </div>
    <div class="note">
      Buttons are missing hover & active states
      <div class="tag work">Work</div>
    </div>
    <div class="note">
      Map all the buttons and links in the new system
      <div class="tag work">Work</div>
    </div>
    <div class="note">
      Buy eggs on your way home
      <div class="tag personal">Personal</div>
    </div>
    <div class="note">
      Call the hospital
      <div class="tag personal">Personal</div>
    </div>
    <div class="note">
      Kafka on the Shore / Haruki Murakami
      <div class="tag read">Read</div>
    </div>
    <div class="note">
      Atomic Habits / James Clear
      <div class="tag read">Read</div>
    </div>
    <div class="note">
      The Design Of Everyday Things / Don Norman
      <div class="tag read">Read</div>
    </div>
    <div class="note">
      Add comments to your code
      <div class="tag work">Work</div>
    </div>
    <div class="note">
      Pay your electricity bill
      <div class="tag personal">Personal</div>
    </div>
    <div class="note">
      After Steve / Tripp Mickle
      <div class="tag read">Read</div>
    </div>
    <div class="note">
      Don't forget about the wedding
      <div class="tag personal">Personal</div>
    </div>
    <div class="note">
      Send the client's brief to the freelancer
      <div class="tag work">Work</div>
    </div>
    <div class="note">
      GIT Commit
      <div class="tag work">Work</div>
    </div>
    <div class="note">
      Send baby photos to the photos place
      <div class="tag personal">Personal</div>
    </div>

  </div>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Inter&display=swap");

#wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #333333;
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  overflow-y: scroll;
}
.flexDiv {
  display: flex;
  position: absolute;
  margin-top: 60px;
  width: 90vw;
  flex-wrap: wrap;
  max-width: 800px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.pos-abs {
  position: absolute;
  top: -50px;
  margin: 8px;
  margin-top: 8px !important;
}
.pos-abs.personal {
  left: 82px;
}
.pos-abs.read {
  left: 192px;
}
.tag {
  padding: 6px 12px;
  width: fit-content;
  border-radius: 9999px;
  margin-top: 12px;
  user-select: none;
}
.work,
.note:has(.work) {
  --tagColor: #fcdbcf;
}
.personal,
.note:has(.personal) {
  --tagColor: #ccdcff;
}
.read,
.note:has(.read) {
  --tagColor: #f9cafc;
}
.work,
.personal,
.read {
  background-color: var(--tagColor);
}
#work-box:checked + label div,
#personal-box:checked + label div,
#read-box:checked + label div {
  background-color: var(--tagColor);
  color: unset;
}
#work-box + label div,
#personal-box + label div,
#read-box + label div {
  background-color: white;
  border: 1px solid var(--tagColor);
  color: var(--tagColor);
}

.note {
  background-color: #ffffff;
  border: 1px solid #ebebeb;
  box-sizing: border-box;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 300ms ease-in-out 0s;
}
.note:hover {
  border-color: var(--tagColor);
}
.note::selection {
  background-color: var(--tagColor);
}
.tag::before {
  content: "#";
  margin-right: 2px;
  opacity: 0.3;
}
#work-box ~ .note:has(.work),
#personal-box ~ .note:has(.personal),
#read-box ~ .note:has(.read) {
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  border-width: 0;
}
#work-box:checked ~ .note:has(.work),
#personal-box:checked ~ .note:has(.personal),
#read-box:checked ~ .note:has(.read) {
  width: 31%;
  height: 160px;
  padding: 3%;
  margin: 1%;
  opacity: 1;
  border-width: 1px;
}
input[type="checkbox"] {
  display: none;
}
label {
  cursor: pointer;
}
label:hover {
  opacity: 0.8;
}

@media screen and (max-width: 400px) {
  .flexDiv {
    flex-direction: column;
  }
  #work-box:checked ~ .note:has(.work),
  #personal-box:checked ~ .note:has(.personal),
  #read-box:checked ~ .note:has(.read) {
    width: 100%;
    height: 160px;
    padding: 3%;
    margin-top: 24px;
    opacity: 1;
    border-width: 1px;
  }
  .note:last-of-type {
    margin-bottom: 24px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console