Pen Settings



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


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.


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.


                <div class="container">
  <h1 class="title">Abc</h1>

  <input class="slider" type="range" min="0" max="20" value="0" autofocus/>
  <p>Use the ◀︎ or ▶︎ keys to tab through the OpenType variations in this <a href="">color font</a></p>
  <code class='code'><pre>h1 {
  font-family: "trajan-color";
  font-feature-settings: "<span class="feature">ss00</span>";



                html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;

body {
  display: flex;
  align-items: center;
  justify-content: center;

* {
  box-sizing: border-box;

h1 {
  font-family: "trajan-color";
  font-size: 200px;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  font-weight: 400;
  margin-bottom: 0;

input {
  font-size: 20px;
  &:hover {
    cursor: pointer;

.container {
  overflow: hidden;
  width: 100%;
  height: 100%;
  background-color: #222222;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: background-color .5s ease;

p {
  margin-bottom: 30px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
font-family: -apple-system, Helvetica, sans-serif;

a {
  color: rgba(255,255,255,0.9);
  transition: .3s color ease;
  &:hover {
    color: rgba(255,255,255,1);

.code {
  padding: 10px 30px;
  border-radius: 2px;
  right: 0;
  top: 0;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid rgba(0,0,0,.4);
  background-color: rgba(0,0,0,.1);

pre {
  font-family: "Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace;


                const slider = document.querySelector('.slider');
const title = document.querySelector('.title');
const container = document.querySelector('.container');
const colors = [

// title.setAttribute('style', 'font-feature-settings: "ss08"');

slider.addEventListener('input', function(e){
  let val = fixString(this.value);
  let fontFeature = `font-feature-settings: "${val}"`;
  let color = getColor(this.value);
  let backgroundColor = `background-color: ${color}`;
  title.setAttribute('style', fontFeature);
  container.setAttribute('style', backgroundColor);

function fixString(sliderValue){
  // if slider is less than ten add a '0' to the beginning
  if(sliderValue < 10) { 
    sliderValue = `0${sliderValue}`;
  // prepend 'ss' to the string
  return `ss${sliderValue}`;

function getColor(num){
  return colors[num];

function code(variant) {
  const feature = document.querySelector('.feature');
  feature.innerText = variant;