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


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


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.


                <button class="Button js-button">
  Hover over me


                :root {
  --button-height: 60px;

html {
  box-sizing: border-box;
  height: 100%;

body {
  margin: 0;
  padding: 20px;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(#ff9966, #ff5e62);
  background-position: center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;

.Button {
  background: 4px solid white;
  border: none;
  display: inline-block;
  height: var(--button-height);
  overflow: hidden;
  padding: 0 40px;
  position: relative;

svg {
  cursor: pointer;
  font-family: 'Roboto';
  font-size: 24px;
  text-transform: uppercase;



                const btn = document.querySelector('.js-button')
const btnText = btn.textContent
const width = btn.clientWidth
const height = btn.clientHeight
const svg = Snap(width, height)
const color1 = '#FFFFFF'
const gradient = 'L(0, 0, 300, 300)#0575E6-#021B79'
const maskOffset = btn.clientHeight

const border = svg
  .rect(0, 0, width, height)
  .attr({ 'fill': 'none', 'stroke': color1, 'stroke-width': 4, 'class': 'border' })

const mask = svg
  .path(`M0,0 L${width + maskOffset},0 L${width},${height} L-${maskOffset}, ${height} Z`)
  .attr({ 'fill': 'white', 'stroke': 'white', 'class': 'mask', 'stroke-width': 0 })
  .transform(`t-${width + maskOffset},0`)

const maskInvert = mask

const text = svg
  .text(width / 2, height / 2, btnText)
  .attr({ 'text-anchor': 'middle', 'dominant-baseline': 'central', 'fill': color1 })

const button = svg
  .group(text, border)
  .attr({ mask: maskInvert })

const textMasked = text
  .attr({ 'fill': gradient })

const borderMasked = border
  .attr({ 'stroke': gradient })

const masked = svg
  .group(textMasked, borderMasked)
  .attr({ mask })

  () => {
    mask.attr('stroke-width', 4)
    mask.stop().animate({ transform: 't0,0' }, 500, mina.easein )
    maskInvert.stop().animate({ transform: `t${width + maskOffset},0` }, 500, mina.easein )
  () => {
    mask.stop().animate({ transform: `t-${width + maskOffset},0` }, 350, mina.easeout, () => mask.attr('stroke-width', 0))
    maskInvert.stop().animate({ transform: 't0,0' }, 350, mina.easeout)
) =>