123

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Categories</h1>


<hr />


<h2>Solid Treatment, All Sizes</h2>

<h3>Small</h3>

<button class="button button--primary button--small button--solid">Save</button>

<button class="button button--secondary button--small button--solid">Save</button>

<button class="button button--tertiary button--small button--solid">Save</button>

<h3>Medium</h3>

<button class="button button--primary button--medium button--solid">Save</button>

<button class="button button--secondary button--medium button--solid">Save</button>

<button class="button button--tertiary button--medium button--solid">Save</button>

<h3>Large</h3>

<button class="button button--primary button--large button--solid">Save</button>

<button class="button button--secondary button--large button--solid">Save</button>

<button class="button button--tertiary button--large button--solid">Save</button>


<hr />


<h2>Hollow Treatment, All Sizes</h2>

<h3>Small</h3>

<button class="button button--primary button--small button--hollow">Save</button>

<button class="button button--secondary button--small button--hollow">Save</button>

<button class="button button--tertiary button--small button--hollow">Save</button>

<h3>Medium</h3>

<button class="button button--primary button--medium button--hollow">Save</button>

<button class="button button--secondary button--medium button--hollow">Save</button>

<button class="button button--tertiary button--medium button--hollow">Save</button>

<h3>Large</h3>

<button class="button button--primary button--large button--hollow">Save</button>

<button class="button button--secondary button--large button--hollow">Save</button>

<button class="button button--tertiary button--large button--hollow">Save</button>
            
          
!
            
              ///////////////////////////////
// ELEMENT LOGIC             //
// Element starts on line 36 //
///////////////////////////////

// Breakpoints:
$bp-lap: 37.5em;  // 600px @ 16px

// Background variables
$background: #fefbef;

// Color variables
$type-light: $background;
$type-dark: #403f3c;
$button-color-primary-light: #ff4136;
$button-color-secondary-light: #357edd;
$button-color-tertiary-light: #808080;

// Border variables
$button-border-width-thin: 2px;
$button-border-width-thick: 3px;









/////////////////////
// ELEMENT STYLING //
/////////////////////

// Declared as a class so we can easily apply it to both `<button>` and `<input type="button">`
.button {

  /////////////////////
  // CORE FORMATTING //
  /////////////////////
  background-color: transparent;
  border: 0;
  color: $type-light;
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  line-height: 1;
  margin-top: 1.5rem;
  width: 100%; // Large, mobile-friendly touch target

  // Media Queries
  @media (min-width: $bp-lap) {
    width: auto; // Smaller buttons on larger screens
    padding-left: 2rem;
    padding-right: 2rem;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  ////////////////
  // PRIORITIES //
  ////////////////
  // Primary buttons
  // `#{&}` interpolates the ampersand selector, letting you target multiple classes on the same element: https://webdesign.tutsplus.com/tutorials/all-you-ever-need-to-know-about-sass-interpolation--cms-21375  
  &--primary#{&}--solid {
    background-color: $button-color-primary-light;
  }

  &--primary#{&}--hollow {
    color: $button-color-primary-light;
    border: $button-border-width-thick solid $button-color-primary-light;
  }

  // Secondary buttons
  &--secondary#{&}--solid {
    background-color: $button-color-secondary-light;
  }

  &--secondary#{&}--hollow {
    color: $button-color-secondary-light;
    border: $button-border-width-thick solid $button-color-secondary-light;
  }

  // Tertiary buttons
  &--tertiary#{&}--solid {
    background-color: $button-color-tertiary-light;
  }

  &--tertiary#{&}--hollow {
    color: $button-color-tertiary-light;
    border: $button-border-width-thick solid $button-color-tertiary-light;
  }

  ///////////
  // SIZES //
  ///////////
  &--small {
    min-width: 6rem;
    border-radius: 0.5rem;
    font-size: 0.8em;
    min-height: 2rem;
  }

  &--small#{&}--hollow {
    border-width: $button-border-width-thin;
  }

  &--medium {
    min-width: 8rem;
    border-radius: 0.75rem;
    min-height: 2.5rem;
  }

  &--large {
    min-width: 10rem;
    border-radius: 0.75rem;
    font-size: 1.2em;
    letter-spacing: 1px;
    min-height: 3rem;
  }
}








/////////////////////
// PAGE FORMATTING //
/////////////////////
body {
  color: $type-dark;
  padding: 3rem;
  background-color: $background;
}

h1,
h2,
h3 {
  margin: 0;
  padding: 0;
}

h1 {
  font-size: 1.5em;
  font-weight: 600;
}

h2 {
  font-size: 1em;
  font-weight: 400;
}

h3 {
  font-size: 0.9em;
  font-weight: 400;
  letter-spacing: 1px;
  margin-top: 2.5em;
  text-transform: uppercase;
}

hr {
  border: 1px solid $type-dark;
  margin-top: 2.5rem;
}
            
          
!
            
                // Applies the class `.background` to `<body>` when the page loads
$(document).ready(function() {
  $('body').addClass('background');
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console