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

              
                <div id="sun">A retrowave sunset</div>

              
            
!

CSS

              
                #sun {
   display: grid;
   grid-template: 1fr / 1fr;
   inline-size: min(80vmin, 400px);
   aspect-ratio: 1;
   border-radius: 50%;
   font-size: 0;
   
   --bg: #f9124f; 
   filter: drop-shadow(0 0 min(20px, 5vmin) var(--bg));
   background: radial-gradient(
      circle at center, 
      var(--bg) 0, var(--bg) 53%, transparent 60%
   );
}

#sun::after {
   content: "";
   grid-area: 1 / 1;
   background: linear-gradient(#fcc22f, #f945e5);
   border-radius: inherit;
   
   --mask: linear-gradient(to top,
     #000 1.5% , #0000 2%   , #0000 5%   , #000 5.5% 
    ,#000 7.5% , #0000 8%   , #0000 10.6%, #000 11.1% 
    ,#000 13.6%, #0000 14.1%, #0000 16.3%, #000 16.8%
    ,#000 19.8%, #0000 20.3%, #0000 22.1%, #000 22.6% 
    ,#000 26.1%, #0000 26.6%, #0000 28%  , #000 28.5% 
    ,#000 32.5%, #0000 33%  , #0000 34%  , #000 34.5% 
    ,#000 39%  , #0000 39.5%, #0000 40.1%, #000 40.6% 
    ,#000 46.6%, #0000 47.1%, #0000 47.5%, #000 48% 
    ,#000 53.5%, #0000 54%  , #0000 54.2%, #000 0
   ) no-repeat;
   
   -webkit-mask: var(--mask);
   mask: var(--mask);
}


/* Sun centering and dark background */
body {
   background: #2e2022;
   display: grid;
   place-items:center;
   min-block-size: 100vh;
}
              
            
!

JS

              
                
              
            
!
999px

Console