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.

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

              
                -
  totalR = 150
  totalD = totalR * 2

  headingOffset = 30
  headingR = totalR - headingOffset
  headingD = headingR * 2
  
  subheadingOffset = 12
  subheadingR = totalR - subheadingOffset
  subheadingD = subheadingR * 2

mixin arcHeading(heading, subheading)
  .arc-heading
    svg(
      xmlns='http://www.w3.org/2000/svg'
      xmlns:xlink='http://www.w3.org/1999/xlink'
      width=totalD + 'px'
      height=totalD + 'px'
      viewBox='0 0 ' + totalD + ' ' + totalD
      )
      defs
        path(
          id='heading-arc'
          d='M ' + headingOffset + ' ' + totalR + ' a ' + headingR + ' ' + headingR + ' 0 1 1 ' + headingD + ' 0' 
          )
        path(
          id='subheading-arc'
          d='M ' + subheadingOffset + ' ' + totalR + ' a ' + subheadingR + ' ' + subheadingR + ' 0 0 0 ' + subheadingD + ' 0'
          )

      use(xlink:href='#heading-arc' fill='none')
      use(xlink:href='#subheading-arc' fill='none')

      text.arc-heading__heading(fill='#fff' text-anchor='middle')
        textPath(startOffset='50%' xlink:href='#heading-arc')= heading
      text.arc-heading__subheading(fill='#fff' text-anchor='middle')
        textPath(startOffset='50%' xlink:href='#subheading-arc')= subheading

      // Inner circles
      // Not required for text effect, just used for demo
      circle(cx=totalR, cy=totalR, r=totalR-40, fill='#f5f5f5')
      circle(cx=totalR, cy=totalR, r=totalR-50, fill='#aaaaaa')

.container
  +arcHeading('Hello there', 'More text')
  +arcHeading('More text than the other', 'More text around the bottom')

              
            
!

CSS

              
                $color--bg = #444
$color--white = #f5f5f5
$color--primary = #aaa

.arc-heading

  // Debug colours: shows text path
  // path
  //   stroke lime
  //   stroke-width 1px

  .arc-heading__heading
  .arc-heading__subheading
    font-family 'Oswald', sans-serif
    text-transform uppercase
    line-height 1
    
  .arc-heading__heading
    font-size rem(30)
    fill $color--white

  .arc-heading__subheading
    font-size rem(20)
    fill $color--primary
    letter-spacing tracking(50)
    
//
// DEMO STYLES
//

html, body
  height 100%
  
body
  background $color--bg
  background linear-gradient(tint($color--bg, 10%), shade($color--bg, 10%))
  background-attachment fixed
  display flex
  align-items center
  
.container
  padding 20px
  margin auto
              
            
!

JS

              
                
              
            
!
999px

Console