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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <script>
  if ('paintWorklet' in CSS) {
    // load this CodePen's JS file as the paint worklet
    CSS.paintWorklet.addModule('/una/pen/RMVjaQ.js');
  } else {
    document.querySelector('html').classList.add('no-support');
  }
</script>

<h1 class="speech">Hello World!</h1>
<br/><br/>
<h2 class="speech">What a Wonderful Life! I Can Keep Going!</h2>
<br/><br/>
<p class="speech">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Excepturi, aliquid nemo earum perspiciatis harum nihil sint expedita labore, architecto maxime in error officia iusto iure. <br><br>Alias similique error vero ab!Minus ad provident a omnis, porro eum iste quia at eaque vel quidem neque dolorum? Aliquam provident rem id in repellat impedit voluptatum tempora, odit vero eaque dolorem, cum voluptatibus?<br><br>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Excepturi, aliquid nemo earum perspiciatis harum nihil sint expedita labore, architecto maxime in error officia iusto iure. <br><br>Alias similique error vero ab!Minus ad provident a omnis, porro eum iste quia at eaque vel quidem neque dolorum? Aliquam provident rem id in repellat impedit voluptatum tempora, odit vero eaque dolorem, cum voluptatibus?</p>

<br>

<div class="warning">
  <i class="fas fa-exclamation-triangle"></i>
  This Houdini demo requires the <strong>CSS Paint API</strong>. Use <strong>Chrome</strong>. <br> Also make sure you're serving over <strong>https</strong> or <strong>localhost</strong>.
</div>

            
          
!

CSS

            
              *, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-size: 20px;
  font-family: monospace;
  text-align: center;
}

.speech{
  background-image: paint(rainbowtize);
  padding: 1em;
  display: inline-block;
  border-radius: 20px;
}
            
          
!

JS

            
              /*
This CodePen's JS file has been "hijacked" to serve as the paint worklet file. The if check below ensures the code only runs when referenced as such. JavaScript for the page is at the top of the HTML. I'm only doing this to squeeze everything into one CodePen.

IMPORTANT: If you fork, update the CodePen JS file path in the HTML.

ALSO IMPORTANT: If you edit code here, disable cache and reload. Live preview won't pick up changes in the paint worklet.
*/

if (typeof registerPaint !== 'undefined') {
  class Rainbowtize {
    paint(ctx, size) {
      const w = size.width;
      const h = size.height;
      
      for (var i = 0; i < h; i++) {
        for (var j = 0; j < w; j++) {
          ctx.fillStyle = 'rgb(' + 
            Math.floor(255 - 20 * i) + ', ' +   
            Math.floor(255 - 20 * j) + ', 200)';
          ctx.fillRect(j * 25, i * 25, 25, 25);
        }
      }
    }
  }

  registerPaint('rainbowtize', Rainbowtize);
}

            
          
!
999px

Console