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

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="light">
  <h3>heading 3 for <code>.light</code></h3>
  This is text. 
  <a href="#"> a link to nowhere</a><br>
  <button class="primary">Primary</button> <button class="primary" disabled>Primary disabled</button>
  <button class="secondary">Secondary</button> <button class="secondary" disabled>Secondary disabled</button>
  <br><button>No class</button> <button disabled>No class, disabled</button>

<p>This is the current 
	<span style="color:white; background-color: rgb(var(--red), 0,0)">Red</span> 
	<span style="color:white; background-color: rgb(0, var(--green), 0)">Green</span> 
	<span style="color:white; background-color: rgb(0,0, var(--blue))">Blue</span> 
	</p>
</div>
<div class="dark">
  <h3>heading 3 for <code>.dark</code></h3>
  <p>This is text. 
  <a href="#"> a link to nowhere</a>
  </p><p>The button CSS was designed for a light interface, so it needs adjustment.</p>
  <button class="primary">Primary</button> <button class="primary" disabled>Primary disabled</button>
  <button class="secondary">Secondary</button> <button class="secondary" disabled>Secondary disabled</button>
  <br><button>No class</button> <button disabled>No class, disabled</button>
<p>This is the current 
	<span style="color:white; background-color: rgb(var(--red), 0,0)">Red</span> 
	<span style="color:white; background-color: rgb(0, var(--green), 0)">Green</span> 
	<span style="color:white; background-color: rgb(0,0, var(--blue))">Blue</span> 
	</p>
</div>
<div class="gray">
  <h3>heading 3 for <code>.gray</code></h3>
  This is text. 
  <a href="#"> a link to nowhere</a><br>
  <button class="primary">Primary</button> <button class="primary" disabled>Primary disabled</button>
  <button class="secondary">Secondary</button> <button class="secondary" disabled>Secondary disabled</button>
  <br><button>No class</button> <button disabled>No class, disabled</button>
<p>This is the current 
	<span style="color:white; background-color: rgb(var(--red), 0,0)">Red</span> 
	<span style="color:white; background-color: rgb(0, var(--green), 0)">Green</span> 
	<span style="color:white; background-color: rgb(0,0, var(--blue))">Blue</span> 
	</p>
</div>
<div class="dark">
  <h3>This div is dark</h3>
  <p class="light">This paragraph is light. 
  <a href="#"> a link</a> (light a sets only red and comes before dark a)<br></p>
  <button class="primary">Primary</button> <button class="primary" disabled>Primary disabled</button>
  <button class="secondary">Secondary</button> <button class="secondary" disabled>Secondary disabled</button>
  <p class="gray">This paragraph is gray.
  <button>No class</button> <button disabled>No class, disabled</button></p>
</div>

<hr>
<div class="show">
  <p>This is the class <code>.show</code> which uses inline styles to display the various custom properties.</p>
<p>This is the current 
	<span style="color:white; background-color: rgb(var(--red), 0,0)">Red</span> 
	<span style="color:white; background-color: rgb(0, var(--green), 0)">Green</span> 
	<span style="color:white; background-color: rgb(0,0, var(--blue))">Blue</span> 
	</p>
<p>
	<span style="background-color: var(--rgb); color:var(--black-or-white)">rgb</span> 
	<span style="background-color: var(--not-rgb); color:var(--not-b-or-w)">not-rgb</span> 
	</p>
<p>
	<span style="background-color: var(--rgb-darker-small); color:var(--black-or-white)">rgb-darker-small</span> 
	<span style="background-color: var(--rgb-lighter-small); color:var(--black-or-white)">rgb-lighter-small</span> 
	</p>
<p style="background-color: var(--rgb)">
	<span style="background-color: var(--rgb-alpha-small); color:var(--black-or-white)">rgb-alpha-small</span> 
	<span style="background-color: var(--not-rgb-alpha-small); color:var(--black-or-white)">not-rgb-alpha-small</span> <br>
	<span style="background-color: var(--b-or-w-alpha-small); color:var(--black-or-white)">b-or-w-alpha-small</span> 
	<span style="background-color: var(--not-b-or-w-alpha-small); color:var(--black-or-white)">not-b-or-w-alpha-small</span> 
	</p>
<p>
	<span style="background-color: var(--rgb-alpha-small); color:var(--black-or-white)">rgb-alpha-small</span> 
	<span style="background-color: var(--not-rgb-alpha-small); color:var(--not-b-or-w)">not-rgb-alpha-small</span> 
	</p>
<p>
	<span style="background-color: var(--rgb-alpha-large); color:var(--black-or-white)">rgb-alpha-large</span> 
	<span style="background-color: var(--not-rgb-alpha-large); color:var(--not-b-or-w)">not-rgb-alpha-large</span> 
	</p>
<p style="background-color:silver">
	<span style="background-color: var(--black-or-white); color:var(--rgb)">black-or-white</span>  
	<span style="color: var(--not-rgb); background-color:var(--not-b-or-w)">not-b-or-w</span> 
	</p>
<p style="background-color:silver">
	<span style="background-color: var(--b-or-w-alpha-small); color:var(--rgb)">b-or-w-alpha-small</span>  
	<span style="color: var(--not-rgb); background-color:var(--not-b-or-w-alpha-small)">not-b-or-w-alpha-small</span> 
	</p>
	
</div>
              
            
!

CSS

              
                /** This generates standard properties using the inherited --red, --green, and --blue properties.  **/
* {
	--alpha-step: 10%;
	--alpha-small: calc(var(--alpha-step) * 2);
	--alpha-medium: calc(var(--alpha-step) * 5);
	--alpha-large: calc(var(--alpha-step) * 7);
	--pivot: calc(
    (
      (
        ( (var(--red) * 299) + (var(--green) * 587) + (var(--blue) * 114) ) / 1000
      ) - 128
    ) * -1000
  );
  --not-pivot: calc(var(--pivot) * -1);
  --black-or-white: rgb( var(--pivot),var(--pivot),var(--pivot) );
  --b-or-w-alpha-small: rgba(var(--pivot),var(--pivot),var(--pivot), var(--alpha-small));
  --b-or-w-alpha-medium: rgba(var(--pivot),var(--pivot),var(--pivot), var(--alpha-medium));
  --b-or-w-alpha-large: rgba(var(--pivot),var(--pivot),var(--pivot), var(--alpha-large));
  --not-b-or-w: rgb( var(--not-pivot), var(--not-pivot), var(--not-pivot) );
  --not-b-or-w-alpha-small: rgba( var(--not-pivot), var(--not-pivot), var(--not-pivot), var(--alpha-small) );
  --not-b-or-w-alpha-medium: rgba( var(--not-pivot), var(--not-pivot), var(--not-pivot), var(--alpha-medium) );
  --not-b-or-w-alpha-large: rgba( var(--not-pivot), var(--not-pivot), var(--not-pivot), var(--alpha-large) );
 	--rgb: rgb(var(--red),var(--green),var(--blue));
  --rgb-darker-small: rgb(calc(var(--red) - 25), calc(var(--green) - 25),calc(var(--blue) - 25)); 
  --rgb-lighter-small: rgb(calc(var(--red) + 25), calc(var(--green) + 25),calc(var(--blue) + 25)); 
  --rgb-alpha-small: rgba(var(--red),var(--green),var(--blue), var(--alpha-small));
  --rgb-alpha-medium: rgba(var(--red),var(--green),var(--blue), var(--alpha-medium));
  --rgb-alpha-large: rgba(var(--red),var(--green),var(--blue), var(--alpha-large));
  --not-rgb: rgb(calc(255 - var(--red)), calc(255 - var(--green)),calc(255 - var(--blue)));
  --not-rgb-alpha-small: rgb(calc(255 - var(--red)), calc(255 - var(--green)),calc(255 - var(--blue)), var(--alpha-small)); 
  --not-rgb-alpha-medium: rgb(calc(255 - var(--red)), calc(255 - var(--green)),calc(255 - var(--blue)), var(--alpha-medium)); 
  --not-rgb-alpha-large: rgb(calc(255 - var(--red)), calc(255 - var(--green)),calc(255 - var(--blue)), var(--alpha-large)); 
}

/*** Some ways to use the standard properties above. */
a {	color: var(--rgb); }
a:visited { color: var(--rgb-alpha-large); }
a:hover { color: var(--rgb-lighter-small); }
a:active { background-color: var(--not-rgb-alpha-medium); }

button, input[submit] { 
  --rgb-darker-15: rgb(calc(var(--red) - 38), calc(var(--green) - 38),calc(var(--blue) - 38)); 
	background: var(--rgb); 
	color: var(--black-or-white); 
	border-color: var(--rgb-lighter-small) var(--rgb-darker-15) var(--rgb-darker-15);
	box-shadow: 0 1px 0 var(--rgb-darker-15), 15% );
	text-shadow: 0 -1px 1px var(--rgb-darker-15),
		1px 0 1px var(--rgb-darker-15),
		0 1px 1px var(--rgb-darker-15),
		-1px 0 1px var(--rgb-darker-15);
}
button:hover, input[submit]:hover {
	background: var(--rgb-lighter-small);
	color: var(--black-or-white);
}

button[disabled], input[submit][disabled] { 
	background: var(--rgb-darker-small) !important; 
	color: var(--b-or-w-alpha-medium) !important; 
	border-color: var(--rgb-darker-15) !important;	
}

/*** Define a color for your component. */
div, p{
  background-color: var(--rgb);
  color: var(--black-or-white);
}
.primary {
  --red:   0;   --green: 160;   --blue: 210;
}
.secondary {
  --red: 250;   --green: 250;   --blue: 250;
}

.light {
  --red: 240;   --green: 232;   --blue: 220;
}
.light a {--red: 45}

.dark {
  --red:  60;   --green:  30;   --blue:  40;
}
.dark a {--red: 233; --green: 100}

.gray {
  --red: 110;   --green: 110;   --blue: 110;
}
.gray a {--green: 217}

.show {
  --red: 170;   --green: 119;   --blue: 235;
  background-color: unset;
  color: unset;
}
.show p {color: unset; background-color:unset}
              
            
!

JS

              
                
              
            
!
999px

Console