Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


  function getCookie(name) {
    var value = "; " + document.cookie;
    var parts = value.split("; " + name + "=");
    if (parts.length == 2) return parts.pop().split(";").shift();
  var userType = getCookie("blog"); // You can replace "blog" with whatever you want to name your user type cookie but make sure to match it to your 1st Party Cookie Variable in Google Tag Manager.
  // If your cookie isn't 'undefined' AND its value is either "true" or "yes"...
  if (typeof userType != 'undefined' && userType.match(/true|yes/g))
  // ...set the value to "yes". We're just setting it again to what it already is to be super safe.
    document.cookie = "blog=yes; path=/";
  // Now, if we've come this far, we know the user doesn't have "yes" or "true" meaning they aren't the userType we're concerned with. Well, then we need to check if they've just visited a page that would indicate they just became that user type. The following would set the cookie if the user viewed,, etc.
  else if (location.pathname.indexOf("/blog/") == 0) {
    // Change their status to "yes" if the did indeed visit the indicative page.
    document.cookie = "blog=yes; path=/";
  // If they aren't already the user type and they haven't visited the special page, then set their status to "no". 
  else document.cookie = "blog=no; path=/";
  //Note:  Once we set this up, all users will be set to "no" because the first two conditions in this text will fail.