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

              
                //Inspiration: https://cdpn.io/YjZVdL

a.btn.btn-glow(href='#')
  span Glow Button
              
            
!

CSS

              
                body
    font-family: 'Avenir', sans-serif
    -webkit-text-size-adjust: 100%
    -webkit-font-smoothing: antialiased

.btn
    &.btn-glow
        position: absolute
        top: calc(50% - 20px)
        left: calc(50% - 120px)
        display: inline-block
        padding: 12px 32px
        min-width: 240px
        text-decoration: none
        overflow: hidden
        font-weight: 700
        font-size: 18px
        background: #6D48E5
        border: 0
        color: white
        border-radius: 5px
        box-shadow: 0 6px 12px -2px rgba(#223254,.15)
        span:not(.glow)
            position: relative
            z-index: 1
        &:hover
            color: white
        &:focus
            outline: none
            box-shadow: 0 4px 12px -2px rgba(#223254,.2)
        &:active
            transform: translateY(1px)

.glow
    height: 160px
    width: 160px
    background: radial-gradient(circle closest-side, lighten(#6D48E5, 10%), transparent)
    position: absolute
    border-radius: 100%
    top: -80px
    left: -80px
              
            
!

JS

              
                $glow = $('.btn-glow')

drawGlow = (e) ->
  $t = $(this)
  x = e.pageX - ($t.offset().left)
  y = e.pageY - ($t.offset().top)
  $t.find('.glow').css
    'transform': 'translate(' + x + 'px,' + y + 'px)'

removeGlow = ->
  $('.glow').remove()

addGlow = ->
  $glow.append '<span class="glow"/>'

$glow.on
  'mouseenter': addGlow
  'mousemove': drawGlow
  'mouseleave': removeGlow
              
            
!
999px

Console