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

              
                <div class="range__opsz">
  <div class="text">
    <h1 id="heading">FRANK SPRUNG <br />
      Collectible Soups</h1>

  </div>
  <div id='demo-controls'>
    <div class="controls range-opsz">
      <label for="controls__opsz">Heading Optical Size (16-56)</label>
      <input type="range" name="range-opsz" value="56" id="text-vf-opsz" class="controls--opsz" min="16" max="56"> 
    </div>
  </div>
  <div class="text">
    <p id="paragraph">
      Nautical miles often fool people into thinking of spins around in fancy boats, sunglasses donned with a scarf flying behind in the wind. Make mine neat but astute queen bees always see the zebra in among. The rose garden looked so good in the winter, we then let it grow outside in the summer and were amazed.</p>
  </div>
  <div id='demo-controls'>
    <div class="controls range-opsz">
      <label for="controls__opsz">Paragraph Optical Size (16-56)</label>
      <input type="range" name="range-opsz" value="16" id="text-p-opsz" class="controls--opsz" min="16" max="56"> 
    </div>
  </div>
</div>


              
            
!

CSS

              
                /* Amstelvar Variable Font */
@font-face {
  font-family: 'Amstelvar VF';
  src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/57225/AmstelvarAlpha-VF.ttf') format('truetype');
  font-display: swap;
}

/* using CSS vars to make sliders easier */
:root {
  --p-wght: 88;
  --p-wdth: 402;
  --h1-wght: 100;
  --h1-wdth: 402;
  --h1-opsz: 56;
  --text-p-opsz: 16;
  --text-vf-opsz: 56;
}

p {
	font-family: "Amstelvar VF", Georgia, "New Times Roman", serif;
  font-variation-settings: 
    'wght' var(--p-wght), 
    'wdth' var(--p-wdth), 
    'opsz' var(--text-p-opsz);  
  font-size: 1rem;
  line-height: 1.25;
  margin: 1em auto;
  max-width: 42rem;
	transition: all linear 0.2s; 	
}

h1 {
	font-family: "Amstelvar VF", Georgia, "New Times Roman", serif;
  font-variation-settings: 
    'wght' var(--h1-wght), 
    'wdth' var(--h1-wdth), 
    'opsz' var(--text-vf-opsz);  
  font-size: 3.5em;
  line-height: 1.15;
  margin: 1em auto;
  max-width: 42rem;
	transition: all linear 0.2s; 	
}

  /* Control buttons */
  .controls {
    display: grid;
    margin-top: 2em;
    text-align: center;
    width: 20em;
    margin-left: auto;
    margin-right: auto;

    h3 {
      display: inline;
      font-weight: normal;
      font-family: monospace;
    }
    input {
      padding: 0.25em 0;
    }
    label {
      font-family: Arial, sans-serif;
      font-weight: 500;
      font-stretch: 100%;
      line-height: 1.5;
    }
  }

              
            
!

JS

              
                // get the inputs
const inputs = [].slice.call(document.querySelectorAll('.range__opsz .controls input'));

// listen for changes
inputs.forEach(input => input.addEventListener('change', handleUpdate));
inputs.forEach(input => input.addEventListener('mousemove', handleUpdate));


function handleUpdate(e) {      document.querySelector('.range__opsz').style.setProperty(`--${this.id}`, this.value);
}



              
            
!
999px

Console