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

              
                <div class='piece'></div>
              
            
!

CSS

              
                @import "compass/css3";

@mixin val($properties, $value) {
  @each $prop in $properties { #{$prop}: #{$value}; }
}

@function computeHeight($x, $skewAngle) { 
  @return sin(90deg - $skewAngle) * $x;
}

@function strip-units($number) {
  @return $number / ($number * 0 + 1);
}

@mixin star($size) {
  $height: computeHeight(strip-units($size), 30deg);
  
  width: $size;
  height: #{$height}#{unit($size)};
  position: relative;
  
  @include transition(all .3s);
  @include transform(rotate(-30deg) skewX(30deg));
    
  &:before, 
  &:after {
    $properties: width, height, background;
    content: '';
    position: absolute;
    @include val($properties, 'inherit');
  }
    
  &:before { @include transform(skewX(-30deg) skewX(-30deg)); }
  &:after { @include transform(skewX(-30deg) rotate(-60deg) skewX(-30deg)) }
}

.piece {
  margin: 5em auto;
  background: tomato;
  @include star(10em);
  
  &:hover {
    background: deepskyblue;
  }
}
              
            
!

JS

              
                /*

The shape is made by Ana Tudor (@thebabydino).
I took care of the Sass-ification.

All you have to do is to include the mixin in one of your element to turn it into a wonderful 6-points star. 

You can set the size in the unit you want: px, rem, vh, cm, whatever.

Bonus: transition on pseudo-elements.



Credits: Ana Tudor and myself.

*/
              
            
!
999px

Console