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

              
                <div class="buttons">
  <button class="-bg-yellow">
    <span>Sign up &amp;</span>
    <span>Work with Rippling</span>
    
    <div class="arrowPacman">
      <div class="arrowPacman-clip">
        <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path d="M7.10081 0L5.88245 1.23617L10.7016 6.12576H0V7.87423H10.7016L5.88245 12.7638L7.10081 14L14 7L7.10081 0Z" fill="white"/>
        </svg>
        
        <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path d="M7.10081 0L5.88245 1.23617L10.7016 6.12576H0V7.87423H10.7016L5.88245 12.7638L7.10081 14L14 7L7.10081 0Z" fill="white"/>
        </svg>
      </div>
    </div>
  </button>

  <button class="-bg-purple">
    <span>Sign up &amp;</span>
    <span>Use your own broker</span>
    
    <div class="arrowPacman">
      <div class="arrowPacman-clip">
        <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path d="M7.10081 0L5.88245 1.23617L10.7016 6.12576H0V7.87423H10.7016L5.88245 12.7638L7.10081 14L14 7L7.10081 0Z" fill="white"/>
        </svg>
        
        <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path d="M7.10081 0L5.88245 1.23617L10.7016 6.12576H0V7.87423H10.7016L5.88245 12.7638L7.10081 14L14 7L7.10081 0Z" fill="white"/>
        </svg>
      </div>
    </div>
  </button>
</div>

<!-- Shameless plug 😉 -->
<a class="twitter" href="https://twitter.com/KeenanPayne_" title="Follow me on Twitter" target="_blank">
    <img src="https://assets.codepen.io/174608/twitter.svg" />
</a>
              
            
!

CSS

              
                //
// Pacman Arrow
// ------------

.arrowPacman {
  --arrow-width: 20px;
  --arrow-spacer: 4px;
  --arrow-plus-spacer: calc(var(--arrow-width) + var(--arrow-spacer));
  
  overflow: hidden;
  position: absolute;
  right: -.2em;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--arrow-plus-spacer);
  
  // Descendants
  svg {
    height: 16px;
    width: var(--arrow-width);
    
    &:last-of-type {
      margin-left: var(--arrow-spacer);
    }
  }
}

.arrowPacman-clip {
  align-items: center;
  display: flex;
  overflow: hidden;
  transform: translateX(calc(var(--arrow-plus-spacer) * -1));
  width: calc(var(--arrow-plus-spacer) + var(--arrow-width));
}

// Helpers
@keyframes pacman {
  to {
    transform: translateX(0);
  }
}

@mixin arrowPacmanInteraction() {
  .arrowPacman-clip {
    animation-delay: 150ms;
    animation-duration: 0.8s;
    animation-name: pacman;
    animation-iteration-count: infinite;
    animation-timing-function: cubic-bezier(0.55, 0, 0.21, 1);
  }
}


//
// Container
// ---------

.buttons {
  @media (min-width: 560px) {
    align-items: center;
    display: flex;
    justify-content: center; 
  }

  // Descendants
  button {
    width: 100%;
    
    @media (min-width: 560px) {
      width: auto;
    }
    
    &:not(:first-of-type) {
      margin-top: 1rem;
      
      @media (min-width: 560px) {
        margin-left: 1rem;
        margin-top: 0;
      }
    }
  }
}


//
// Buttons
// -------

button {
  --button-background: transparent;
  --button-color: black;

  background-color: var(--button-background);
  border-radius: 4px;
  border: 0;
  box-shadow: none;
  color: var(--button-color);
  cursor: pointer;
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  height: 64px;
  line-height: 1;
  padding-left: 1rem;
  padding-right: 2rem;
  position: relative;
  text-align: left;
  text-decoration: none;
  transition: box-shadow 150ms cubic-bezier(0.61, 1, 0.88, 1);
  white-space: nowrap;
  
  &:hover,
  &:focus {
    @include arrowPacmanInteraction();
      
    box-shadow: 0 3px 7px 1px rgba(50, 50, 50, 0.25);
  }

  // Background colors
  &.-bg-yellow {
    --button-background: #ffb31c;
  }

  &.-bg-purple {
    --button-background: #502d3c;
    --button-color: #ffb31c;
  }
  
  // Descendants
  > span {
    display: block;
    line-height: 1;
    padding-right: 1.5rem;

    &:first-of-type {
      color: white;
      font-size: .75rem;
      line-height: 1.5;
    }
  }
}


//
// Demo Styles
// -----------

:root {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.twitter { 
  bottom: 0;
  position: fixed;
  right: 0;
  width: 50px;
}
              
            
!

JS

              
                
              
            
!
999px

Console