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

              
                <h1>text spacing bookmarklet</h1>

<p>Quick and dirty testing of <a href="https://www.w3.org/TR/WCAG21/#text-spacing">WCAG 2.1 Success Criterion 1.4.12 Text Spacing</a>.

<p>Experimental:<strong>use at own risk!</strong></p>
<p>Bookmarklet: <a href="javascript:(function(){var d=document,id='phltsbkmklt',el=d.getElementById(id),f=d.querySelectorAll('iframe'),i=0,l=f.length;if(el){function removeFromShadows(root){for(var el of root.querySelectorAll('*')){if(el.shadowRoot){el.shadowRoot.getElementById(id).remove();removeFromShadows(el.shadowRoot);}}}el.remove();if(l){for(i=0;i<l;i++){try{f[i].contentWindow.document.getElementById(id).remove();removeFromShadows(f[i].contentWindow.document);}catch(e){console.log(e)}}}removeFromShadows(d);}else{s=d.createElement('style');s.id=id;s.appendChild(d.createTextNode('*{line-height:1.5 !important;letter-spacing:0.12em !important;word-spacing:0.16em !important;}p{margin-bottom:2em !important;}'));function applyToShadows(root){for(var el of root.querySelectorAll('*')){if(el.shadowRoot){el.shadowRoot.appendChild(s.cloneNode(true));applyToShadows(el.shadowRoot);}}}d.getElementsByTagName('head')[0].appendChild(s);for(i=0;i<l;i++){try{f[i].contentWindow.document.getElementsByTagName('head')[0].appendChild(s.cloneNode(true));applyToShadows(f[i].contentWindow.document);}catch(e){console.log(e)}}applyToShadows(d);}})();">Text Spacing</a>  (drag to bookmarklets bar or right click and save as bookmark)
  
<p><a href="https://codepen.io/stevef/pen/YLMqbo">Edit this</a> on codepen</p>
 <p>Last updated 6th September 2021, now traverses shadow dom, <b>thanks to <a href="https://github.com/shoffing">@shoffing</a></b></p>
 <p>updated 18th May 2021. Now toggles on/off (first time you run it, it adds the styles ... second time, it removes them again) <b>Thanks to Patrick H. Lauke</b></p>
<p>updated 7 October 2020. Now works on content inside same-origin first level <code>iframe</code>s - i.e. it doesn't then work if there's an <code>iframe</code> inside another <code>iframe</code>. <b>Thanks to Patrick H. Lauke and Jon Gibbins</b></p>

              
            
!

CSS

              
                /* rules for bookmarklet test
* {
 line-height: 1.5 !important;
 letter-spacing: 0.12em !important;
 word-spacing: 0.16em !important;
}

p{
 margin-bottom: 2em !important;
} */
              
            
!

JS

              
                
              
            
!
999px

Console