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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                <ul class="color-palette">
  <li class="color-blue">
    <span class="swatch"></span>
    Blue
  </li>
  <li class="color-red">
    <span class="swatch"></span>
    Red
  </li>
  <li class="color-green">
    <span class="swatch"></span>
    Green
  </li>
  <li class="color-gray">
    <span class="swatch"></span>
    Gray
  </li>
  <li class="color-dark-gray">
    <span class="swatch"></span>
    Dark Gray
  </li>
</ul>

<div class="headings simple">
  <h1>This is an H1 heading</h1>
  <h2>This is an H2 heading</h2>
  <h3>This is an H3 heading</h3>
  <h4>This is an H4 heading</h4>
  <h5>This is an H5 heading</h5>
  <h6>This is an H6 heading</h6>
</div>

</ul>

<div class="headings complex">
  <h1>This is an H1 heading</h1>
  <h2>This is an H2 heading</h2>
  <h3>This is an H3 heading</h3>
  <h4>This is an H4 heading</h4>
  <h5>This is an H5 heading</h5>
  <h6>This is an H6 heading</h6>
</div>

<div class="buttons">
  <div class="button-blue">Blue</div>
  <div class="button-red">Red</div>
  <div class="button-green">Green</div>
  <div class="button-gray">Gray</div>
  <div class="button-dark-gray">Dark Gray</div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic|Open+Sans:400italic,700italic,400,300,700);


////////////
// COLORS //
////////////

$colors: (
	blue: #2980b9,
	red: #e74c3c,
	green: #27ae60,
	gray: #95a5a6,
	dark-gray: #2c3e50
);

ul {
  margin: 0;
  padding: 0;
  text-align: center;
}

li {
	display: inline-block;
	width: 15%;
	margin: 2% 1%;
	padding: .5em;
	box-shadow: 0 1px 4px -1px rgba(0,0,0,.5);
}

.swatch {
	display: block;
	height: 0;
	margin-bottom: .5em;
	padding: 100% 0 0;
}

@each $name, $value in $colors {
	.color-#{$name} {
		.swatch {
			background-color: $value;
		}
	}
}

//////////////
// HEADINGS //
//////////////

$sans: Open Sans, Tahoma, sans-serif;
$serif: Droid Serif, Palatino, serif;

body {
  font-family: $sans;
}

$headings: (
	h1: bold 2em/1.2 $sans,
	h2: light 1.5em/1.2 $sans,
	h3: bold 1.2em/1.2 $sans,
	h4: bold 1em/1.2 $sans,
	h5: bold 1em/1.2 $serif,
	h6: italic 1em/1.2 $serif
);

$headings-complex: (
	h1: (
		font: bold 2em/1.2 $sans,
		color: map-get($colors, blue)
	),
	h2: (
		font: 200 1.5em/1.2 $sans,
		letter-spacing: .1em,
		text-transform: uppercase,
		color: map-get($colors, dark-gray)
	),
	h3: (
		font: bold 1.2em/1.2 $sans,
		color: map-get($colors, dark-gray)
	),
	h4: (
		font: normal 1em/1.2 $sans,
		letter-spacing: .1em,
		text-transform: uppercase,
    color: map-get($colors, dark-gray)
	),
	h5: (
		font: bold 1em/1.2 $serif,
    color: map-get($colors, blue)
	),
	h6: (
		font: italic 1em/1.2 $serif,
    color: map-get($colors, dark-gray)
	)
);

.headings {
  padding: 1em 0;

  &.simple {
    @each $element, $font-property in $headings {
      #{$element} {
        font: $font-property;
      }
    }
  }
  &.complex {
    @each $element, $style-map in $headings-complex {
      #{$element} {
        @each $property, $value in $style-map {
          #{$property}: $value;
        }
      }
    }
  }
}

@mixin button($color) {
	display: inline-block;
	background-color: $color;
	color: white;
	border-radius: .25em;
	line-height: 1;
  text-transform: uppercase;
	padding: .5em 1em;
  text-shadow: 1px 1px 1px rgba(0,0,0,.5);
  box-shadow: 
		inset 0 .125em .5em rgba(255,255,255,.25),
		inset 0 -.125em .5em rgba(0,0,0,.25);

	&:hover {
		background-color: darken($color, 5%);
	}
}

@each $name, $value in $colors {
	.button-#{$name} {
		@include button($value);
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console