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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="center">
  <h1 class="console">console.log(<span class="red">R</span><span class="orange">O</span><span class="yellow">Y</span><span class="green">G</span><span class="teal">T</span><span class="blue">B</span><span class="purple">P</span>);</h1>
  <p>Open the console for colorful logs</p>
</div>
              
            
!

CSS

              
                html,
body {
  height: 100%;
}

body {
  background-color: #1B2B34;
  font-family: "Lucida Grande", sans-serif;
  font-size: 14px;
  color: #65737E;
  text-align: center;
  display: flex;
}

.center {
  margin: auto;
}

.console {
  color: #CDD3DE;
  font-family: "Lucida Console", Monaco, monospace;
}

.gray {
  color: #1B2B34;
}
.red {
  color: #EC5f67;
}
.orange {
  color: #F99157;
}
.yellow {
  color: #FAC863;
}
.green {
  color: #99C794;
}
.teal {
  color: #5FB3B3;
}
.blue {
  color: #6699CC;
}
.purple {
  color: #C594C5;
}
.brown {
  color: #AB7967;
}


              
            
!

JS

              
                /** 
Colors from the Ocean Next Theme
https://github.com/voronianski/oceanic-next-color-scheme#color-palette

Post about console log styles:
http://jscottsmith.me/notes/styling-your-console-logs 
**/

// Styles and Colors
var colors = {
	"gray": "font-weight: bold; color: #1B2B34;",
	"red": "font-weight: bold; color: #EC5f67;",
	"orange": "font-weight: bold; color: #F99157;",
	"yellow": "font-weight: bold; color: #FAC863;",
	"green": "font-weight: bold; color: #99C794;",
	"teal": "font-weight: bold; color: #5FB3B3;",
	"blue": "font-weight: bold; color: #6699CC;",
	"purple": "font-weight: bold; color: #C594C5;",
	"brown": "font-weight: bold; color: #AB7967;"
}
// All the colors
console.log('%cHello', colors.gray);
console.log('%cHello', colors.red);
console.log('%cHello', colors.orange);
console.log('%cHello', colors.yellow);
console.log('%cHello', colors.teal);
console.log('%cHello', colors.blue);
console.log('%cHello', colors.purple);
console.log('%cHello', colors.brown);
// Log with multiple colors
console.log('%cGray %cRed %cOrange %cYellow %cGreen %cTeal %cBlue %cPurple %cBrown', colors.gray, colors.red, colors.orange, colors.yellow, colors.green, colors.teal, colors.blue, colors.purple, colors.brown);
// Log that's partially colored and the rest is default styling
console.log('%cWarning: %cThe cake is a lie', colors.red, '');
              
            
!
999px

Console