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

              
                <h1>Color themes using CSS Variables</h1><div class="container">
   <input type="radio" id="yellow" name="colors" checked/>
  <label for="yellow"/></label>
<input type="radio" id="orange" name="colors"/>
  <label for="orange"/></label>
     <input type="radio" id="pink" name="colors"/>
  <label for="pink"/></label>
<input type="radio" id="red" name="colors"/>
  <label for="red"/></label>
<input type="radio" id="purple" name="colors"/>
  <label for="purple"/></label>
<input type="radio" id="blue" name="colors"/>
  <label for="blue"/></label>
<input type="radio" id="green" name="colors"/>
  <label for="green"/></label>
<div class="cards-wrapper">
  <div class="card">
    <div class="image"></div>
    <div class="text">
      <h5 class="title with-tag"></h5>
      <span class="tag"></span>
      <span class="tag"></span>
      <span class="tag"></span>
      <div class="paragraph color-gray"><p></p>
        <p></p>
        <p></p>
        <p></p>
        <p></p>
      </div>
      <div class="divider">
      <button><span></span></button>
      </div>
    </div>
  </div>
  <div class="card">
    <div class="image"></div>
    <div class="text">
      <h5 class="title with-tag"></h5>
      <span class="tag"></span>
      <span class="tag"></span>
      <span class="tag"></span>
      <div class="paragraph color-gray"><p></p>
        <p></p>
        <p></p>
        <p></p>
        <p></p>
      </div>
      <div class="divider">
      <button><span></span></button>
      </div>
    </div>
  </div>
    
  </div>
</div>
</div>


              
            
!

CSS

              
                :root {
  --colorMain: #444;
  --colorLight: #999;
  --colorAccent: #ddd;
}

body {
  background: #fef5e5;
  font-family: 'Zilla Slab', serif;
  font-weight: 400;
  text-align: center;
  padding: 20px;
}
h1 {
  font-size: 40px;
  line-height: 1.1;
  width: 70%;
  margin: 40px auto;
  text-transform: uppercase;
}

/*color picker*/
[type="radio"] {
  display: none;
}
label {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #f9f9f9, 0 0 0 3px #ddd;
  cursor: pointer;
}
[type="radio"]:checked + label {
  box-shadow: 0 0 0 2px #f9f9f9, 0 0 0 3px var(--colorMain);
}
#yellow + label {
  background: #FFD94E;
}
#orange + label {
  background: #F2921B;
}
#pink + label {
  background: #FFA1AD;
}
#red + label {
  background: #A4303F;
}
#purple + label {
  background: #8C6796;
}
#blue + label {
  background: #4EBCFF;
}
#green + label {
  background: #AFC97E;
}
#yellow:checked ~ .cards-wrapper, #yellow:checked + label {
  --colorMain: #FFD94E;
  --colorLight: #ffe37e;
  --colorAccent: #ffedae;
}
#orange:checked ~ .cards-wrapper, #orange:checked + label {
  --colorMain: #F2921B;
  --colorLight: #f5af59;
  --colorAccent: #f9cd97;
}
#pink:checked ~ .cards-wrapper, #pink:checked + label {
  --colorMain: #FFA1AD;
  --colorLight: #ffc3ca;
  --colorAccent: #ffdce1;
}
#red:checked ~ .cards-wrapper, #red:checked + label {
  --colorMain: #A4303F;
  --colorLight: #c57b84;
  --colorAccent: #d5a0a7;
}
#purple:checked ~ .cards-wrapper, #purple:checked + label {
  --colorMain: #8C6796;
  --colorLight: #ab90b2;
  --colorAccent: #d5c7d8;
}
#blue:checked ~ .cards-wrapper, #blue:checked + label {
  --colorMain: #4EBCFF;
  --colorLight: #93daff;
  --colorAccent: #ceecff;
}
#green:checked ~ .cards-wrapper, #green:checked + label {
  --colorMain: #AFC97E;
  --colorLight: #c4d7a1;
  --colorAccent: #d3e1b8;
}

/*cards*/
.cards-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  padding: 30px;
}
.card {
  flex: 1;
  background: #fff;
  padding: 23px 20px;
  border-radius: 4px;
  margin: 10px;
  position: relative;
  overflow: hidden;
  text-align: left;
  min-width: 200px;
  max-width: 300px;
}
.card:before {
  content: '';
  position: absolute;
  height: 6px;
  width: 100%;
  top: -1px;
  left: 0;
  background: var(--colorMain);
}
.image {
  background: var(--colorLight);
  background: linear-gradient(
    to bottom right,
    var(--colorLight),
    var(--colorAccent)
  );
  width: 100%;
  height: 160px;
  border-radius: 3px;
}
.title {
  margin: 20px 0;
  background: var(--colorMain);
  height: 25px;
  width: 85%;
  border-radius: 20px;
}
.title.with-tag {
  margin: 20px 0 10px;
}
.tag {
  width: 45px;
  height: 10px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 20px;
  background: var(--colorAccent);
}
.divider {
  border-top: 1px solid #eee;
  padding-top: 20px;
}
button {
  border-radius: 30px;
  background: var(--colorMain);
  border: none;
  border: 4px solid var(--colorMain);
  width: 100%;
  padding: 15px;
  text-align: center;
}
button span {
  width: 40%;
  height: 8px;
  background: #fff;
  display: inline-block;
  border-radius: 20px;
}
.paragraph {
  margin: 20px 0;
}
.paragraph p {
  width: 90%;
  background: #ddd;
  height: 15px;
  margin: 0 0 12px;
  border-radius: 20px;
}
.paragraph p:nth-child(2n + 2) {
  width: 80%;
}
.paragraph p:last-child {
  width: 40%;
}

              
            
!

JS

              
                
              
            
!
999px

Console