Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <p>Preserved as it was just so that you can see what a pain it was to emulate a conic gradient with a linear one, but please keep in mind that this is not recommended code today anymore. Use <a href="https://codepen.io/thebabydino/pen/qBELQwz" target="_blank">the 2020 version instead</a>.</p>
<div class='rainbow-wheel'></div>
              
            
!

CSS

              
                html { overflow: hidden }
body { background: gainsboro; } 
.rainbow-wheel {
  position: relative;
  margin: 1em auto;
  border: solid 2em white;
  width: 16em; height: 16em;
  border-radius: 50%;
  background: 
    linear-gradient(36deg, #272b66 42.34%, transparent 42.34%) 0 0,
    linear-gradient(72deg, #2d559f 75.48%, transparent 75.48%) 0 0,
    linear-gradient(-36deg, #9ac147 42.34%, transparent 42.34%) 100% 0,
    linear-gradient(-72deg, #639b47 75.48%, transparent 75.48%) 100% 0, 
    linear-gradient(36deg, transparent 57.66%, #e1e23b 57.66%) 100% 100%,
    linear-gradient(72deg, transparent 24.52%, #f7941e 24.52%) 100% 100%,
    linear-gradient(-36deg, transparent 57.66%, #662a6c 57.66%) 0 100%,
    linear-gradient(-72deg, transparent 24.52%, #9a1d34 24.52%) 0 100%, 
    #43a1cd linear-gradient(#ba3e2e, #ba3e2e) 50% 100%;
  background-repeat: no-repeat;
  background-size: 50% 50%;
  transition: 1s
}

.rainbow-wheel::after {
  position: absolute;
  top: 50%; left: 50%;
  margin: -2.8em;
  width: 5.6em; height: 5.6em;
  border-radius: 50%;
  /* add slash at end of line to see central part *
  opacity: .15; /**/
  background: white;
  content: ''
}

.rainbow-wheel:hover { transform: rotate(360deg) }
              
            
!

JS

              
                /*
detailed explanation about the maths of how to compute angles and percentages for the gradients  http://hugogiraudel.com/blog/css-gradients
*/
              
            
!
999px

Console