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

              
                .pyramid-chart
%ul.pyramid-legend
  %li{"data-legend": "sky"} Sky
  %li{"data-legend": "pyramid"} Sunny side of pyramid
  %li{"data-legend": "pyramid-shades"} Shady side of pyramid

              
            
!

CSS

              
                $colorSky: #6d9eed
$colorPyramid: #ffd866
$colorPyramidShades: #7e5f02
$colorGray: #ccc

*, *::before, *::after
  box-sizing: border-box

\:root
  font-size: 62.5%

body
  display: flex
  justify-content: center
  align-items: center
  align-content: center
  flex-wrap: wrap
  
  width: 100%
  min-height: 100vh
  
  margin: 0
  padding: 1rem
  font: 1.4rem/1.1 sans-serif
  
.pyramid-chart
  position: relative
  min-width: 35rem
  min-height: 35rem
  border-radius: 17.5rem
  background: $colorSky
  overflow: hidden
  
  &::before
    content: ''
    display: block
    width: 100%
    height: 100%
    border: 17.5rem solid transparent
    border-bottom-color: $colorPyramid

  &::after
    content: ''
    position: absolute
    left: 50%
    top: 50%
    display: block
    width: 0
    height: 0
  
    border-style: solid
    border-width: 35rem 0 0 17.5rem
    border-color: transparent transparent transparent $colorPyramidShades
    transform-origin: top left
    transform: rotate( -19deg )

.pyramid-legend
  margin: 0
  padding: 2rem
  list-style: none
  
  li
    padding: .5rem
    display: block
      
    &::before
      content: ''
      display: inline-block
      width: .8em
      height: .8em

      margin-right: .5em
      background: $colorGray
      
    &[data-legend=sky]::before
      background: $colorSky
    &[data-legend=pyramid]::before
      background: $colorPyramid
    &[data-legend=pyramid-shades]::before
      background: $colorPyramidShades
      
@media ( max-width: 400px )
  \:root
    font-size: 30%
  
  .pyramid-legend
    font-size: 150%
              
            
!

JS

              
                
              
            
!
999px

Console