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

              
                p.quote
  span.b Design
  span is a funny word.
  span Some people think design means
  span how it looks.
  span But of course, if you dig deeper,
  span it's really how it
  span.b works.

              
            
!

CSS

              
                $num-lines: 7
$mid-line: ceil($num-lines / 2)
  
body
  text-align: center
  color: #080808
  background: #c13389
    
.b
  font-weight: bold
 
.quote
  position: absolute
  top: 50%
  left: 50%
  line-height: 1em
  width: 168px
  margin: 0
  font-family: 'Arvo', serif
  font-style: italic
  transform-origin: 0 0
  transform: rotate(-13deg) translate(-50%, -50%)

  svg
    position: relative
    transition: width 0.5s, opacity 0.3s 0.2s

    @for $i from 1 through $num-lines
      &:nth-of-type(#{$i})
        $offset: $mid-line - $i
        left: $offset * 5px

  &:hover 
    svg:not(:first-child):not(:last-child)
      width: 1px
      opacity: 0
      transition: width 0.5s, opacity 0.3s

              
            
!

JS

              
                // fitter happier text
!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.fitterHappierText=t()}}(function(){return function t(e,r,i){function n(f,u){if(!r[f]){if(!e[f]){var s="function"==typeof require&&require;if(!u&&s)return s(f,!0);if(o)return o(f,!0);throw new Error("Cannot find module '"+f+"'")}var l=r[f]={exports:{}};e[f][0].call(l.exports,function(t){var r=e[f][1][t];return n(r?r:t)},l,l.exports,t,e,r,i)}return r[f].exports}for(var o="function"==typeof require&&require,f=0;f<i.length;f++)n(i[f]);return n}({1:[function(t,e){e.exports=function(t,e){for(var e=e||{},r=e.baseline||16,i=e.paddingY||0,n=e.doc||document,o=0;o<t.length;o++){var f,u,s=t[o].textContent,l=n.createElementNS("http://www.w3.org/2000/svg","svg"),a=n.createElementNS("http://www.w3.org/2000/svg","text");a.textContent=s,a.setAttribute("x","50%"),a.setAttribute("y",r),a.setAttribute("font-family","inherit"),a.setAttribute("font-size","1rem"),a.setAttribute("font-weight","inherit"),a.setAttribute("style","text-anchor:middle");for(var d=0;d<t[o].attributes.length;d++)l.setAttribute(t[o].attributes[d].name,t[o].attributes[d].value);l.setAttribute("width","100%"),l.setAttribute("style","max-height:100%"),l.setAttribute("fill","currentcolor"),l.setAttribute("overflow","visible"),l.appendChild(a),t[o].parentNode.replaceChild(l,t[o]),f=a.offsetWidth||a.getComputedTextLength(),u=a.offsetHeight||24,l.setAttribute("viewBox","0 0 "+f+" "+(u+i))}}},{}]},{},[1])(1)});

fitterHappierText(document.querySelectorAll('.quote span'));

              
            
!
999px

Console