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

              
                <main>
  <h1>:is Demo</h1>

  <article>
    <h2>I am a second level heading</h2>
    <h3>I am an h3</h3>
    <h4>What do you know, an h4</h4>
    <h5>How often do you get to h5?</h5>
    <h6>Raise your hand if you've used an h6</h6>
    <p>This is a paragraph. It isn't special.</p>
  </article>

  <div class="callout">
    <h2>I am a second level heading</h2>
    <h3>I am an h3</h3>
    <h4>What do you know, an h4</h4>
    <h5>How often do you get to h5?</h5>
    <h6>Raise your hand if you've used an h6</h6>
    <p>This paragraph is in a callout. It isn't special.</p>
  </div>
</main>
              
            
!

CSS

              
                /* re-write the following selectors 
  using either :is() or CSS Nesting  */

.callout h2,
.callout h3,
.callout h4,
.callout h5,
.callout h6 {
  font-variation-settings: "wght" 900;
}

/* 
  For a hint,
  see Stacy's original pen:
  https://codepen.io/stacy/pen/BavoVgp?editors=1100
*/

/* All Styles that aren't part of workshop, but help with the styling of the demo. */
h2,
h3,
h4,
h5,
h6 {
  font-variation-settings: "wght" 200;
}

html {
  --neutral-dark: color(display-p3 0.1 0.0052 0.0305);
  --neutral-light: color(display-p3 0.6621 0.6183 0.6563);
}

body {
  background: hsl(213 20% 20%);
  color: white;
  font-family: "loew-variable", sans-serif;
  font-variation-settings: "ital" 0, "wght" 300, "wdth" 100;
  font-size: min(1.1rem + 0.15vw, 1.5rem);
  font-weight: 300;
  line-height: 1.4;
  padding: 0 2rem;
}

/* Layout Styles
   ------------- */
main {
  display: grid;
  margin-block-start: 2rem;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
}

/* Callout Styles 
   --------------*/
.callout {
  background-color: var(--callout-background, white);
  border-color: var(--callout-border-color, var(--neutral-light));
  border-radius: 1rem;
  border-style: solid;
  border-width: 0 0 0 1rem;
  color: var(--callout-color, var(--neutral-dark));
  padding: 2rem;
}

article {
  padding: 2rem 0;
}
/* Typography Styles
   ----------------- */
h1 {
  font-size: min(3.5rem + 1vw, 5rem);
  grid-column: 1 / -1;
}

h2 {
  font-size: min(1.5rem + 1vw, 2.5rem);
  line-height: 1.15;
}

h2,
h3,
h4,
h5,
h6 {
  font-variation-settings: "wght" 200;
  font-weight: normal;
  margin: 0 0 0.5rem;
}

              
            
!

JS

              
                // Layers by Rio pratam from <a href="https://thenounproject.com/browse/icons/term/layers/" target="_blank" title="Layers Icons">Noun Project</a> (CC BY 3.0)
// Crop by Rio pratam from <a href="https://thenounproject.com/browse/icons/term/crop/" target="_blank" title="Crop Icons">Noun Project</a> (CC BY 3.0)

              
            
!
999px

Console