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

              
                <div class="container">
  <section class="column typo">
    Font Sizes
    <hr>
    <span class="text-1">size-1</span>
    <span class="text-2">size-2</span>
    <span class="text-3">size-3</span>
    <span class="text-4">size-4</span>
    <span class="text-5">size-5</span>
    <span class="text-6">size-6</span>
    <span class="text-7">size-7</span>
    <span class="text-8">size-8</span>
    <span class="text-9">size-9</span>
    <span class="text-10">size-10</span>
  </section>
  <section class="column">
    Spacing sizes
    <hr>
    <div class="look size-1">asdf</div>
    <div class="look size-2">asdf</div>
    <div class="look size-3">asdf</div>
    <div class="look size-4">asdf</div>
    <div class="look size-5">asdf</div>
    <div class="look size-6">asdf</div>
    <div class="look size-7">asdf</div>
    <div class="look size-8">asdf</div>
    <div class="look size-9">asdf</div>
    <span>root user stylesheet font size, default is 16px:</span>
    <div class="look size-10">asdf</div>
    <div class="look size-11">asdf</div>
    <div class="look size-12">asdf</div>
    <div class="look size-13">asdf</div>
    <div class="look size-14">asdf</div>
    <div class="look size-15">asdf</div>
    <div class="look size-16">asdf</div>
    <div class="look size-17">asdf</div>
    <div class="look size-18">asdf</div>
    <div class="look size-19">asdf</div>
  </section>
</div>
              
            
!

CSS

              
                
:root{
  font-family: sans-serif;
  --base: calc(1rem/4);
  --scaling-down: 0.5;
  --scaling-up: 1.225;
  --size-1:   var(--base);
  --size-2:   calc( var(--size-1) * var(--scaling-up));
  --size-3:   calc( var(--size-2) * var(--scaling-up));
  --size-4:   calc( var(--size-3) * var(--scaling-up));
  --size-5:   calc( var(--size-4) * var(--scaling-up));
  --size-6:   calc( var(--size-5) * var(--scaling-up));
  --size-7:   calc( var(--size-6) * var(--scaling-up));
  --size-8:   calc( var(--size-7) * var(--scaling-up));
  --size-9:   calc( var(--size-8) * var(--scaling-up));
  --size-10:  calc( var(--size-9) * var(--scaling-up) );
  --size-11:  calc( var(--size-10) * var(--scaling-up) );
  --size-12:  calc( var(--size-11) * var(--scaling-up) );
  --size-13:  calc( var(--size-12) * var(--scaling-up) );
  --size-14:  calc( var(--size-13) * var(--scaling-up) );
  --size-15:  calc( var(--size-14) * var(--scaling-up) );
  --size-16:  calc( var(--size-15) * var(--scaling-up) );
  --size-17:  calc( var(--size-16) * var(--scaling-up) );
  --size-18:  calc( var(--size-17) * var(--scaling-up) );
  --size-19:  calc( var(--size-18) * var(--scaling-up) );
}

* {
  // outline:1px dashed coral;
}

body{
 padding:40px;
}

span{display: block;}
div{border-bottom:1px solid white;}

.container{
  display: grid;
  gap: 4rem;
  grid-template-columns: repeat(2, 1fr);
}

.column{
  display: flex;
  flex-direction: column;
}

hr{
  width: 100%;
  height: 1px;
  border: 0;
  border-bottom: 1px solid #ddd;
}

.column span{
  padding: 4px;  
}

.typo{
  text-align: right;
}

.look{
  padding: 3px 0;
  border-radius: 3px;
  background-color:gold;
  color: rgba(0,0,0,.3);
}

.size-{
  &1 {width: var(--size-1); background-color:dodgerblue;}
  &2 {width: var(--size-2); }
  &3 {width: var(--size-3); }
  &4 {width: var(--size-4); }
  &5 {width: var(--size-5); }
  &6 {width: var(--size-6); }
  &7 {width: var(--size-7); }
  &8 {width: var(--size-8); }
  &9 {width: var(--size-9); }
  &10{width: var(--size-10);background-color:dodgerblue;}
  &11{width: var(--size-11);}
  &12{width: var(--size-12);}
  &13{width: var(--size-13);}
  &14{width: var(--size-14);}
  &15{width: var(--size-15);}
  &16{width: var(--size-16);}
  &17{width: var(--size-17);}
  &18{width: var(--size-18);}
  &19{width: var(--size-19);}
}

.text-{
  &1 {font-size: var(--base) ;}
  &2 {font-size: var(--size-11) ;}
  &3 {font-size: var(--size-12) ;}
  &4 {font-size: var(--size-13) ;}
  &5 {font-size: var(--size-14) ;}
  &6 {font-size: var(--size-15) ;}
  &7 {font-size: var(--size-16) ;}
  &8 {font-size: var(--size-17) ;}
  &9 {font-size: var(--size-18) ;}
  &10 {font-size: var(--size-19) ;}
}
              
            
!

JS

              
                const text1 = document.querySelector('.text-1');
const text2 = document.querySelector('.text-2');
const text3 = document.querySelector('.text-3');
const text4 = document.querySelector('.text-4');
const text5 = document.querySelector('.text-5');
const text6 = document.querySelector('.text-6');
const text7 = document.querySelector('.text-7');
const text8 = document.querySelector('.text-8');
const text9 = document.querySelector('.text-9');
const text10 = document.querySelector('.text-10');

const style1 = getComputedStyle(text1);
const style2 = getComputedStyle(text2);
const style3 = getComputedStyle(text3);
const style4 = getComputedStyle(text4);
const style5 = getComputedStyle(text5);
const style6 = getComputedStyle(text6);
const style7 = getComputedStyle(text7);
const style8 = getComputedStyle(text8);
const style9 = getComputedStyle(text9);
const style10 = getComputedStyle(text10);

text1.innerHTML = style1.fontSize;
text2.innerHTML = style2.fontSize;
text3.innerHTML = style3.fontSize;
text4.innerHTML = style4.fontSize;
text5.innerHTML = style5.fontSize;
text6.innerHTML = style6.fontSize;
text7.innerHTML = style7.fontSize;
text8.innerHTML = style8.fontSize;
text9.innerHTML = style9.fontSize;
text10.innerHTML = style10.fontSize;

// spacing sizes 

const size1 = document.querySelector('.size-1');
const size2 = document.querySelector('.size-2');
const size3 = document.querySelector('.size-3');
const size4 = document.querySelector('.size-4');
const size5 = document.querySelector('.size-5');
const size6 = document.querySelector('.size-6');
const size7 = document.querySelector('.size-7');
const size8 = document.querySelector('.size-8');
const size9 = document.querySelector('.size-9');
const size10 = document.querySelector('.size-10');
const size11 = document.querySelector('.size-11');
const size12 = document.querySelector('.size-12');
const size13 = document.querySelector('.size-13');
const size14 = document.querySelector('.size-14');
const size15 = document.querySelector('.size-15');
const size16 = document.querySelector('.size-16');
const size17 = document.querySelector('.size-17');
const size18 = document.querySelector('.size-18');
const size19 = document.querySelector('.size-19');

const sizeStyle1 = getComputedStyle(size1);
const sizeStyle2 = getComputedStyle(size2);
const sizeStyle3 = getComputedStyle(size3);
const sizeStyle4 = getComputedStyle(size4);
const sizeStyle5 = getComputedStyle(size5);
const sizeStyle6 = getComputedStyle(size6);
const sizeStyle7 = getComputedStyle(size7);
const sizeStyle8 = getComputedStyle(size8);
const sizeStyle9 = getComputedStyle(size9);
const sizeStyle10 = getComputedStyle(size10);
const sizeStyle11 = getComputedStyle(size11);
const sizeStyle12 = getComputedStyle(size12);
const sizeStyle13 = getComputedStyle(size13);
const sizeStyle14 = getComputedStyle(size14);
const sizeStyle15 = getComputedStyle(size15);
const sizeStyle16 = getComputedStyle(size16);
const sizeStyle17 = getComputedStyle(size17);
const sizeStyle18 = getComputedStyle(size18);
const sizeStyle19 = getComputedStyle(size19);

size1.innerHTML = sizeStyle1.width;
size2.innerHTML = sizeStyle2.width;
size3.innerHTML = sizeStyle3.width;
size4.innerHTML = sizeStyle4.width;
size5.innerHTML = sizeStyle5.width;
size6.innerHTML = sizeStyle6.width;
size7.innerHTML = sizeStyle7.width;
size8.innerHTML = sizeStyle8.width;
size9.innerHTML = sizeStyle9.width;
size10.innerHTML = sizeStyle10.width;
size11.innerHTML = sizeStyle11.width;
size12.innerHTML = sizeStyle12.width;
size13.innerHTML = sizeStyle13.width;
size14.innerHTML = sizeStyle14.width;
size15.innerHTML = sizeStyle15.width;
size16.innerHTML = sizeStyle16.width;
size17.innerHTML = sizeStyle17.width;
size18.innerHTML = sizeStyle18.width;
size19.innerHTML = sizeStyle19.width;
              
            
!
999px

Console