cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <svg class="visuallyHidden">

  <!-- Base 0.0 to 1.0 values on the size of the bounding box.
       Essentially turn them into viewport units or percentages. -->
  <filter id="svg-underline" primitiveUnits="objectBoundingBox">
    
    <!-- Take the original image (the text) and expand it a little
         horizontally and a little more vertically. Then store it
         in a new layer. -->
    <feMorphology in="SourceGraphic" operator="dilate" radius="0.0075 0.05" result="outline"></feMorphology>
    
    <!-- Make a blue rectangle that’s 3% tall and 100% wide and expand it
         a little horizontally and a position it below the original text. -->
    <feFlood flood-color="blue" width="1" height="0.03" x="0" y="0.85" result="underline"></feFlood>
    
    <!-- Take the blue rectange and use the expanded text layer to mask
         out the parts we don’t want. This is where it skips descenders. -->
    <feComposite in="underline" in2="outline" operator="out" result="underline"></feComposite>
    
    <!-- Now stack the underline and the original text for export. -->
    <feMerge>
      <feMergeNode in="underline"></feMergeNode>
      <feMergeNode in="SourceGraphic"></feMergeNode>
    </feMerge>
  </filter>
</svg>

<p class="font-size-16px">
  <span class="underline">Tricky handgloves</span>
</p>

<p class="font-size-21px">
  <span class="underline">Tricky handgloves</span>
</p>

<p class="font-size-36px">
  <span class="underline">Tricky handgloves</span>
</p>

<p class="font-size-48px">
  <span class="underline">Tricky handgloves</span>
</p>

<p class="font-size-72px">
  <span class="underline">Tricky handgloves</span>
</p>
            
          
!
            
              .underline {
  // Use the default underline for browsers that
  // don’t support @supports (<= IE11)
  text-decoration: underline;
  
  // Use the filter in browsers that support @supports, but aren’t Safari
  @supports not (-webkit-text-decoration-skip: objects) {
    filter: url('#svg-underline');
    text-decoration: none;
  }

  // And then disable the filter in Edge and
  // use the default underline instead
  @supports (-ms-ime-align: auto) {
    color: red;
    filter: none;
    text-decoration: underline;
  }
}

// Remove the SVG from the UI, but keep it the layout.
// This makes sure Firefox can reference the SVG filter.

.visuallyHidden {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  width: 1px;
}

// ----- Unrelated ----- //
    
html {
  $square-color: #eee;
  $square-size: 8px;
  line-height: 1;
  padding: 20px;
  background-image:
    linear-gradient(45deg, $square-color 25%, transparent 25%, transparent 75%, $square-color 75%, $square-color), 
    linear-gradient(45deg, $square-color 25%, transparent 25%, transparent 75%, $square-color 75%, $square-color);
  background-position: 0 0, $square-size $square-size;
  background-size: ($square-size * 2) ($square-size * 2);
  font-family: 'Source Sans Pro', sans-serif;
}

body {
  margin-left: auto;
  margin-right: auto;
  max-width: 600px;
}

p {
  margin: 0;
  margin-bottom: 20px;
  
  &:last-child {
    margin-bottom: 0;
  }
}

@for $index from 1 through 100 {
  .font-size-#{ $index }px {
    font-size: #{ $index }px;
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console