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

              
                <h1>Mix Your Palette: Mountain Highlights</h1>

<svg id="thing" xmlns="http://www.w3.org/2000/svg" version="1.1" width="550px" height="250px">
  <g class="shadow">
    <polygon points="3,233 133,98 263,233" />
    <polygon points="133,233 263,8 393,233" />
    <polygon points="263,233 393,118 523,233" />
  </g>
  <g class="highlight">
    <polygon class="peak1" points="9,237 139,102 269,237" />
    <polygon class="peak2" points="139,237 269,12 399,237" />
    <polygon class="peak3" points="269,237 399,122 529,237" />
  </g>
  <g class="main">
    <polygon class="peak1" points="5,235 135,100 265,235" />
    <polygon class="peak2" points="135,235 265,10 395,235" />
    <polygon class="peak3" points="265,235 395,120 525,235" />
  </g>
</svg>

<p>Comment and un-comment blocks in the .scss to see different versions of the highlights on the mountains:</p>

<ul>
  <li>Block 1 shows white and black highlights.</li>
  <li>Block 2 shows higlights mixed with the mountain's colors.</li>
  <li>Block 3 shows lovely pink highlights.</li>
  <li>Block 4 shows sunset-orange highlights.</li>
</ul>

<!--<p>This demo accompanies my "Color in the Real World" presentation at SassConf 2014. Slides are at <a href="https://rawgit.com/KatieK2/2014-sassconf/master/index.html">https://rawgit.com/KatieK2/2014-sassconf/master/index.html</a> but may be of limited value without having seen the talk.</p>-->
              
            
!

CSS

              
                $mountain-color: #686;
/* Block 1
$highlight: white;
$shadow: black;
*/
/* Block 2
$highlight: mix($mountain-color, white, 40%);
$shadow: mix($mountain-color, black, 40%);
*/
/* Block 3
$highlight-base: #C6538C;
$highlight: mix($mountain-color, lighten(#C6538C, 10%), 50%);
$shadow: mix($mountain-color, darken(#C6538C, 25%), 70%);
*/
/* Block 4 */
$highlight-base: #FF5F00;
$highlight: mix($mountain-color, lighten($highlight-base, 20%), 20%);
$shadow: mix($mountain-color, darken($highlight-base, 20%), 20%);


g.highlight {
  fill: transparent;
  stroke-linejoin: round;
  stroke-width: 5;
  stroke: $highlight;
}

g.shadow {
  stroke: $shadow;
  @extend g.highlight;
}

.peak1 {
  fill: darken($mountain-color, 10%);
}

.peak2 {
  fill: $mountain-color;
}

.peak3 {
  fill: lighten($mountain-color, 10%);
}

/* set up styles ---------------------------- */

body {
  background-color: rgb(128,128,128);
}

h1, h2, p, svg {
  margin: 1rem;
}
              
            
!

JS

              
                
              
            
!
999px

Console