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 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

              
                Nothing here... please open your browser console ;)

              
            
!

CSS

              
                
              
            
!

JS

              
                /*** Welcome ***/

console.log("%c🍓 Welcome to my Console! 🍓", "color: #f4675d; font-size: 30px; border: 3px solid #52a776; border-radius: 5px; padding: 20px; margin: 80px 20px;");


/*** Objects ***/

const fruits  = {'name': 'Strawberry', 'color': 'red', 'size': 'small', 'image': '🍓'};
const veggies = {'name': 'Broccoli', 'color': 'green', 'size': 'medium', 'image': '🥦'};

console.group("___ Logging the Objects ___");

// 1. straightforward output
console.log(fruits); 

// 2. Frustrating output
console.log('fruits are: ' + fruits);     // :(

// 3. Using the %o string substitution for objects, it's way better!
console.log('veggies are: %o', veggies);  // :)

// 4. Returning multiple objects at once
console.log({ fruits, veggies });

// 5. log() vs info() to display objects in strings
console.log("Shopping list: " + fruits + " and " + veggies);  // :(
console.info("Shopping list: ", fruits, " and ", veggies);    // :)

// 6. Returning object attributes with template literals
console.log(`Shopping list short version: \n- ${fruits.name} \n- ${veggies.name}`);

console.groupEnd();


/*** Colors ***/

console.group("___ Adding colors ___");

// 7. Adding colors
console.log('%c Important debug', 'color: red; font-weight: bold;');

// 8. Using colors, string substitution and template literals
const step = 1;
const success = true;
const msg = (success) ? 'success' : 'error';
const msgColor = (success) ? 'green' : 'red';
console.log('%c Debug %c - Step %i: %c%s', 'background: FireBrick; color: white; font-weight: bold', 'font-weight: bold', step, `color: ${msgColor}`, msg);

console.groupEnd();


/***  Table  ***/

console.group("___ Table ___");

// 9. Displaying objects in a table (same attributes)
console.table([fruits, veggies]);

// 10. Displaying objects in a table (different attributes)
const meat = {'name': 'Chicken', 'weight': '2kg'};
console.table([fruits, veggies, meat]);

console.groupEnd();
              
            
!
999px

Console