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="wheel">
  <div class="umbrella">
    <div class="quarter"></div>
    <div class="quarter"></div>
    <div class="quarter"></div>
    <div class="quarter"></div>
  </div>
</div>
              
            
!

CSS

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

$size: 100px;

.wheel {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -$size/2;
  width: $size;
  height: $size;
  overflow: hidden;
  -moz-transform: scale(2);
  -webkit-transform: scale(2);
}
/* A crude mask, because the compositor does not
 * support clipping with border-radius. One alternative
 * would be SVG masks. Too lazy though. */
.wheel:before {
  content: "";
  position: absolute;
  top: -$size;
  left: -$size;
  right: -$size;
  bottom: -$size;
  border: $size solid #fff;
  border-radius: 50%;
  z-index: 1;
}
.umbrella {
  position: absolute;
  top: $size/20;
  width: $size;
  height: $size;
  -moz-perspective: $size/4;
  -moz-perspective-origin: $size/2 $size/4;
  -moz-transform: scale(.2);
  -webkit-perspective: $size/4;
  -webkit-perspective-origin: $size/2 $size/4;
  -webkit-transform: scale(.2);
}
  .quarter {
    position: absolute;
    overflow: hidden;
    width: $size/2;
    height: $size/2;
    -moz-transform-origin: $size/2 $size/4;
    -webkit-transform-origin: $size/2 $size/4;
  }
  .quarter:nth-child(1) {
    -moz-transform: scale(strip-units($size)/2000) rotateY(45deg);
    -webkit-transform: scale(strip-units($size)/2000) rotateY(45deg);
    background: linear-gradient(to bottom, #9ED110 0%, #50B517 33.33%, #179067 66.67%, #476EAF 100%);
  }
  .quarter:nth-child(2) {
    -moz-transform: scale(strip-units($size)/2000) rotateZ(-90deg) rotateY(45deg);
    -webkit-transform: scale(strip-units($size)/2000) rotateZ(-90deg) rotateY(45deg);
    background: linear-gradient(to bottom, #476EAF 0%, #9f49ac 33.33%, #CC42A2 66.67%, #FF3BA7 100%);
  }
  .quarter:nth-child(3) {
    -moz-transform: scale(strip-units($size)/2000) rotateZ(-180deg) rotateY(45deg);
    -webkit-transform: scale(strip-units($size)/2000) rotateZ(-180deg) rotateY(45deg);
    background: linear-gradient(to bottom, #FF3BA7 0%, #FF5800 33.33%, #FF8100 66.67%, #FEAC00 100%);
  }
  .quarter:nth-child(4) {
    -moz-transform: scale(strip-units($size)/2000) rotateZ(-270deg) rotateY(45deg);
    -webkit-transform: scale(strip-units($size)/2000) rotateZ(-270deg) rotateY(45deg);
    background: linear-gradient(to bottom, #FEAC00 0%, #FFCC00 33.33%, #EDE604 66.67%, #9ED110 100%);
  }

              
            
!

JS

              
                
              
            
!
999px

Console