Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <h1>Experiments with Sass Color Functions</h1>

<p>Top and bottom border to all divs are generated with <code>grayscale($color)</code> and <code>desaturate($color, 20)</code>, respectively.</p>

<h2>Sass Native:</h2>

<div class="darken">
  <pre>darken($color, 20);</pre>
  <p>Darken base color by 20%.</p>
  <p class="docs"><a href="">Documentation.</a> Related: <a href="">lighten</a></p>

<div class="complement">
  <p class="docs"><a href="">Documentation.</a></p>

<div class="saturate">
  <pre>saturate($color, 20);</pre>
  <p>Increase saturation of base color by 20%.</p>
  <p class="docs"><a href="">Documentation</a>. Related: <a href="">desaturate</a></p>

<div class="invert">
  <p class="docs"><a href="">Documentation.</a></p>

<div class="mix">
  <pre>mix($color, #00F, 75%);</pre>
  <p>Mix blue into the base color by 75%.</p>
  <p class="docs"><a href="">Documentation.</a></p>

<div class="hue">
  <pre>adjust_hue($color, 110);</pre>
  <p>Rotate base color by 110 degrees around the color wheel.</p>
  <p class="docs"><a href="">Documentation</a></p>

<div class="adjust-single">
  <pre>adjust-color($color, $green: 128);</pre>
  <p>Add a hue to a color, by value. Use a negative number to subtract a color.</p>
  <p class="docs"><a href="">Documentation.</a> Related: <a href="">scale-color</a>, <a href="">change-color</a></p>

<div class="adjust-multiple">
  <pre>adjust-color($color, $green: -64, $blue: -64)</pre>
  <p>Remove multiple hues from a color, by value. Use a positve number to add a hue.</p>
  <p class="docs"><a href="">Documentation.</a></p>

<div class="transparentize">
  <pre>transparentize(gray, .5);</pre>
  <p>Adjust the transparency (alpha) of a color.</p>
  <p class="docs"><a href="">Documentation.</a> Related: <a href="">fade-out</a>, <a href="">opacify</a>, <a href="">transparentize</a></p>

<div class="red">
  <pre>rgb(red($color), 0, 0)</pre>
  <p>Use only the amount of red in the base color.</p>
  <p class="docs"><a href="">Documentation.</a></p>

<div class="green">
  <pre>rgb(0, green($color), 0);</pre>
  <p>Use only the amount of green in the base color.</p>
  <p class="docs"><a href="">Documentation.</a></p>

<div class="blue">
  <pre>rgb(0, 0, blue($color));</pre>
  <p>Use only the amount of blue in the base color.</p>
  <p class="docs"><a href="">Documentation.</a></p>

<p>Also see color "getter" functions:</p>
  <li><a href="">hue($color)</a></li>
  <li><a href="">saturation($color)</a></li>
  <li><a href="">lightness($color)</a></li>
  <li><a href="">alpha($color)</a></li>


<div class="shade">
  <pre>shade($color, 50%);</pre>
  <p>Mix <code>$color</code> with black, by %.</p>
  <p class="docs"><a href="">Documentation.</a> Related:  <a href="">tint</a></p>


                @import "compass/css3";

$color: #C6538C;  // Sass Pink

/* Other interesting / enlightening color values
$color: #C6538C;  // Sass Pink
$color: #bada55;
$color: #cab1e5;
$color: #c0ffee;
$color: blueviolet;
$color: goldenrod;
$color: darkturquoise;

body {
  background-color: $color;

.darken {
  background-color: darken($color, 20);

.complement {
  background-color: complement($color);

.saturate {
  background-color: saturate($color, 20);

.invert {
  background-color: invert($color);

.mix {
  background-color: mix($color, #00F, 75%);

.hue {
  background-color: adjust_hue($color, 110);

.adjust-single {
  background-color: adjust-color($color, $green: 128);

.adjust-multiple {
  background-color: adjust-color($color, $green: -64, $blue: -64);

.transparentize {
  background-color: transparentize(gray, .5);

.red {
  background-color: rgb(red($color), 0, 0);

.green {
  background-color: rgb(0, green($color), 0);

.blue {
  background-color: rgb(0, 0, blue($color));

.shade {
  background-color: shade($color, 50%);

div {
  color: white;
  border-top: solid grayscale($color) 5px;
  border-bottom: solid desaturate($color, 20) 5px;
  font-weight: bold;
  width: 46%;
  padding: 1%;
  margin: 1%;
  float: left;

  &:nth-child(2n) { clear:left; }
  pre { font-size: large; margin: .5rem; }
  p { margin: .5rem;
    &.docs {font-weight: normal;}

p { clear: both; }