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

              
                <div class="btn-container">
  <a href="#!" class="glossy-btn">Button!</a>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Inter:wght@500&display=swap')

body, html 
  height 100%

.btn-container
  display flex
  flex-direction column
  justify-content center
  align-items center
  position relative
  height 100%
  
.glossy-btn
  border-radius 124px
  background radial-gradient(185.08% 100% at 50% 0%, #DEDEFF 0%, #E9E9FF 21.35%, #D7D9F8 69.27%, #eff7ff 100%)
  box-shadow 0px 12.991px 25.983px 0px #dce9fd
  color #4042a1
  font-family 'Inter', sans-serif
  font-weight 500
  font-size 2rem
  padding 20px 40px
  text-decoration none
  display inline-block
  background-size 100% 100%
  position relative
  transition .4s
  cursor pointer
  overflow hidden
  
  &:hover
    background-size 100% 120%
    transform translateY(-4px)
    box-shadow 0px 12.991px 25.983px 0px #c7d9f5
    transition .4s
    
  &:active
    transform scale(0.9)
  
  &:after
    content ""
    position absolute
    top calc(var(--y, 0) * 1px - 50px)
    left calc(var(--x, 0) * 1px - 50px)
    width 100px
    height 100px
    background radial-gradient(white, #3984ff00 80%)
    opacity 0
    transition opacity .4s
    
  &:hover
    &:after
      opacity .4
              
            
!

JS

              
                const button = document.querySelector(".glossy-btn");

button.addEventListener("mousemove", (e) => {
  const { x, y } = button.getBoundingClientRect();
  button.style.setProperty("--x", e.clientX - x);
  button.style.setProperty("--y", e.clientY - y);
}); 
              
            
!
999px

Console