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 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

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.

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

              
                <script>
  (async function() {
    if (CSS["paintWorklet"] === undefined)
      await import(
        "https://unpkg.com/css-paint-polyfill@next/dist/css-paint-polyfill.js"
      );
    CSS.paintWorklet.addModule(
      "https://unpkg.com/curved-line@1.0.0/curved-line.js"
    );
  })();
</script>
<main>
  <h1>CurvedLine</h1>
  <p>
    The future of CSS is getting exciting with the arrival of
    <strong>CSS Houdini</strong>. Using its <strong>Paint API</strong>, we can create our
    custom style implementation.
  </p>
  <hr />
  <p>The browser supports for <strong>Paint API</strong> is also
    getting better, and with a polyfill, we can support out more browsers.
  </p>
  <p>
    <strong>CurvedLine (curved-line)</strong> is a CSS Houdini implementation to create a custom horizontal line.
  </p>
  <h2>You can customize it!</h2>
  <p>
    With the help of CSS properties, you can change the shape of the horizontal line.
  </p>
  <p>For example, you can make it dark blue, and more curved:</p>
  <hr class="custom-line-1" />
  <p>or, you reduced the curved size, make it to bright pink, and shorten the interval:</p>
  <hr class="custom-line-2" />
  <p>or, you can also shorten more the interval to make a diffferent feel with the line:</p>
  <hr class="custom-line-3" />
  <p>Further reading:</p>
  <ul>
    <li><a href="https://codepen.io/hazmi/pen/VwKreoq">See this demo on Codepen</a></li>
    <li><a href="https://codepen.io/hazmi/pen/poEdNPr">See more examples on Codepen</a></li>
    <li><a href="https://github.com/hazmi/curved-line">CurvedLine Github repository</a></li>
    <li><a href="https://houdini.how/">See more information about CSS Houdini</a></li>
  </ul>
</main>
              
            
!

CSS

              
                main {
  max-width: 500px;
  margin: 30px auto;
  color: #152831;
  font-family: "Graphik", "Helvetica Neue", helvetica, "Apple Color Emoji",
    arial, sans-serif;
  font-size: 14px;
}
hr {
  height: 20px;
  border: 0;
  background: paint(curved-line);
}
.custom-line-1 {
  --curved-lineHeight: 30; /* default: element height */
  --curved-lineWidth: 5; /* default: 3 */
  --curved-lineColor: midnightblue; /* default: 'black' */
  --curved-lineSpread: 20; /* default: 50 */
  height: 50px;
}
.custom-line-2 {
  --curved-lineHeight: 5; /* default: element height */
  --curved-lineWidth: 2; /* default: 3 */
  --curved-lineColor: deeppink; /* default: 'black' */
  --curved-lineSpread: 10; /* default: 50 */
  height: 10px;
}
.custom-line-3 {
  --curved-lineHeight: 5; /* default: element height */
  --curved-lineWidth: 5; /* default: 3 */
  --curved-lineColor: saddlebrown; /* default: 'black' */
  --curved-lineSpread: 2; /* default: 50 */
  height: 10px;
}

              
            
!

JS

              
                
              
            
!
999px

Console