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

              
                <!-- Don't mess with the markup -->

<ul>
  <li class="primary">$primary<span class="core">core</span></li>
  <li class="primary-hover">$primary-hover</li>
</ul>

<ul>
  <li class="secondary">$secondary<span class="core">core</span></li>
  <li class="secondary-hover">$secondary-hover</li>
</ul>

<ul>
  <li class="dark">$dark<span class="core">core</span></li>
  <li class="dark-85">$dark-85</li>
  <li class="dark-70">$dark-70</li>
  <li class="dark-60">$dark-60</li>
  <li class="dark-50">$dark-50</li>
</ul>

<ul>
  <li class="light-110">$light-110</li>
  <li class="light">$light<span class="core">core</span></li>
  <li class="light-95">$light-95</li>
  <li class="light-90">$light-90</li>
</ul>

<ul>
  <li class="success">$success<span class="core">core</span></li>
  <li class="info">$info<span class="core">core</span></li>
  <li class="warning">$warning<span class="core">core</span></li>
  <li class="danger">$danger<span class="core">core</span></li>
</ul>
              
            
!

CSS

              
                /* Core Variables
---
Insert core variables here, and SASS will generate the full color palette below.*/

$primary: #00C54A;
$secondary: #0D69D1;
$dark: #0C1C24;
$light: #DAE0E3;

$success: $primary;
$info: $secondary;
$warning: #FF9C2B;
$danger: #F13C46;

/* End variables*/

.core {
  background-color: rgba(0,0,0,.2);
  border-radius: 2px;
  bottom: 15px;
  color: white;
  left: 15px;
  padding:  1px 5px;
  position: absolute;
}

ul li {
  border-radius: 3px;
  color: #FFF;
  display: inline-block;
  font-family: "helvetica";
  font-size: 12px;
  font-weight: bold;
  height: 100px;
  line-height: 1.5;
  list-style: none;
  margin: 30px 40px 0 0;
  padding: 15px;
  position: relative;
  width: 150px;
  
  
&.primary {
    background-color: $primary;
  }
&.primary-hover {
    background-color: darken($primary,10%);
  }
  
  
&.secondary {
    background-color: $secondary;
  }
&.secondary-hover {
    background-color: darken($secondary,10%);
  }
  
  
&.dark {
    background-color: $dark;
  }
&.dark-85 {
    background-color: tint($dark,15%);
  }  
&.dark-70 {
    background-color: tint($dark,30%);
  }
&.dark-60 {
    background-color: tint($dark,40%);
  }
&.dark-50 {
    background-color: tint($dark,50%);
  }  

&.light-110 {
    background-color: darken($light,10%);   
    color: #000;
  }
&.light {
    background-color: $light; 
    color: #000;
  }
&.light-95 {
    background-color: lighten($light,5%); 
    color: #000;
  }
&.light-90 {
    background-color: lighten($light,10%); 
    color: #000;
  }

&.success {
    background-color: $success;
  }
&.info {
    background-color: $info;
  }
&.warning {
    background-color: $warning;
  }
&.danger {
    background-color: $danger;
  }
  
}

              
            
!

JS

              
                //This JS samples the hex values and outputs them for easy copy/paste into design files.

//NOTE: It needs to be rerun sometimes, you can do this by just adding a space or line and deleting it.

$('li').each(function(){
  var rgb = $(this).css('background-color');  
  rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
    function hex(x) {return ("0" + parseInt(x).toString(16)).slice(-2);}
  rgb = "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
  
  $(this).append("</br> "+rgb);
});
              
            
!
999px

Console