cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <!-- Regular CSS: you have to use .button and .button_primary to get things to work -->
<a href="#" class="button">.button</a>

<a href="#" class="button button_primary">.button .button_primary</a>

<div class="output">
  <h5>Output</h5>
  <img src="http://elyseholladay.com/gdi/sass/output1.jpg">
</div>





<!-- Include with SASS: there is no button2 class to include. you use the class of the button type and @include .button2 in the SASS  -->
<a href="#" class="button2">button2 (mixin)</a>

<a href="#" class="button2_primary">.button2_primary @include button2</a>




<div class="output">
  <h5>Output</h5>
<img src="http://elyseholladay.com/gdi/sass/output2.jpg">
</div>



<!-- Extend with SASS: don't have to use .button3 class AND .button3_primary, but in the output  -->
<a href="#" class="button3">.button3</a>

<a href="#" class="button3_primary">.button3_primary @extend .button3</a>



<div class="output">
  <h5>Output</h5>
<img src="http://elyseholladay.com/gdi/sass/output3.jpg">
</div>



<!-- %Extend with SASS: don't have to use .button3 class AND .button3_primary, but in the output  -->
<a href="#" class="button4">%button4</a>

<a href="#" class="button4_primary">.button4_primary @extend %button4</a>
  
  
<div class="output">
  <h5>Output</h5>
<img src="http://elyseholladay.com/gdi/sass/output4.jpg">
</div>
            
          
!
            
              @import compass


      
// REGULAR CSS/SASS
// a button needs both classes .button and .button_primary for things to work
.button
    display: inline-block
    padding: 6px 10px
    text-transform: uppercase
    margin-right: 10px
    cursor: pointer
    font-family: "Proxima Nova", Arial, san-serif
    text-decoration: none
    border: 2px solid black

    // primary button defines the color/style
    // &. means it will only apply if .button is ALSO there
    &.button_primary
        background: #C21A01
        border-color: #9F111B
        color: #fff
          
          
          
          
// INCLUDE
// .button2 isn't a class that can be applied on its own, but is a mixin that can ONLY be @included 
@mixin button2
    display: inline-block
    padding: 6px 10px
    text-transform: uppercase
    margin-right: 10px
    cursor: pointer
    font-family: "Proxima Nova", Arial, san-serif
    text-decoration: none
    border: 2px solid black

// not nested because button2 is a mixin, not a class. must include button2 or the button2 styles won't apply
.button2_primary
    @include button2
    background: #5dade2
    border-color: #2980B9
    color: #fff
      
      

      
// EXTEND
// .button3 is a class that can be applied, or if it isn't, you can @extend it
.button3
    display: inline-block
    padding: 6px 10px
    text-transform: uppercase
    margin-right: 10px
    cursor: pointer
    font-family: "Proxima Nova", Arial, san-serif
    text-decoration: none
    border: 2px solid black

// here you @extend .button3 and only have class .button3_primary in the HTML
.button3_primary
    @extend .button3
    background: #601848
    border-color: #300030
    color: #fff
      
      
      
      
// %extend
// like a mixin, %button4 isn't a class that can be applied on its own, but notice the difference in output
%button4
    display: inline-block
    padding: 6px 10px
    text-transform: uppercase
    margin-right: 10px
    cursor: pointer
    font-family: "Proxima Nova", Arial, san-serif
    text-decoration: none
    border: 2px solid black
      
// primary button, not nested, using a placeholder
.button4_primary
    @extend %button4
    background: #FABE28
    border-color: #FF8A00
    color: #fff

    
    
    
    
    
    
.output
    clear: both
    width: 300px
    margin: 2em
    font-family: "Proxima Nova", Arial, san-serif

h5
    font-size: 20px
    text-transform: uppercase
    
    
    
            
          
!
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.
Loading ..................

Console