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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                .milky-way.universe
  .sun.star
  %span.mercury.planet
  %span.venus.planet
  %span.earth.planet
  %span.mars.planet
  %span.jupiter.planet
  %span.saturn.planet
  %span.uranus.planet
  %span.neptune.planet
              
            
!

CSS

              
                $space:#222;
$sun:#fdef89;
$master-size:5vmax;
$planet-sizes:(
  $master-size * .1,
  $master-size * .2,
  $master-size * .3,
  $master-size * .2,
  $master-size * .5,
  $master-size * .4,
  $master-size * .3,
  $master-size * .2
);
$planet-colors:(
  #eedbc6,
  #ffba40,
  #32bcf0,
  #f95739,
  #fc934b,
  #ffefb2,
  #84cdc8,
  #7599eb
);
@mixin size($size) {
  height:$size;
  left:calc(50% - #{$size} * .5); // set the left side to 50% minus half the size
  top:calc(50% - #{$size} * .5); // set the top side to 50% minus half the size
  width:$size;
}
@mixin pseudo($size) {
  border-radius:50%;
  content:"";
  display:block;
  height:$size;
  left:calc(#{$size} * -.5);
  position:absolute;
  top:calc(50% - (#{$size} * .5));
  width:$size;
}

* {
  box-sizing:border-box;
  position:relative;
}
body {
  background:#111;
  background:$space;
  overflow:hidden;
}
.milky-way {
  height:60vmin;
  margin:10% auto;
  width:60vmin;
}
.star,.planet {
  @include size(50%);
  border:1px solid #333;
  border-radius:50%;
  display: block;
  position: absolute;
}
.sun {
  @include size($master-size);
  background:$sun;
  border:0;
}
// .milky-way:hover .planet {
//   animation-play-state:paused; // pause animation when you hover over the universe
// }
@for $i from 1 through 8 { // iterate for each orbital path
  .planet:nth-of-type(#{$i}) {
    @include size($master-size * ($i + 1));
    animation: orbit ($i + ($i * .5) + 1.1s) infinite linear ($i - 10s); // negative numbers in the animation-delay make it start in the middle of the animation; this keeps us from having a "line" of planets when the animation starts
  }
}
@for $i from 1 through 8 { // iterate for each planet
  .planet:nth-of-type(#{$i}):before {
    @include pseudo(#{nth($planet-sizes,$i)}); // iterate through planet size list
    background:nth($planet-colors,$i); // iterate through planet color list
  }
}
@keyframes orbit {
	0% {
	  transform:rotate(0deg);
	}
	100% {
	  transform:rotate(360deg);
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console