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

              
                <section id="scss">
<h1>SCSS事始め</h1>
<p class="lede">CodepenのSettingの旅CSS編第2回。今回はSCSS。LESSに似てる?</p>
<section id="nest">
    <h2>ネスト(階層化)</h2>
    <p>SCSSもdivのネストの階層化ができる。この段落は<em>ネスト</em>でスタイルを当てている。<br>
      ん?この書き方はLESSとほぼまったく同じだ。<br>
 <span class="bikou">インデントについても厳密でじゃでなくても解釈してくれるようだ(?)</span>
    </p>
  </section>
  <section id="oya">
    <h2>親セレクタの参照</h2>
    <p>おそらくLESSにはないSCSS専用の機能。ネストして「&」に擬似要素を付けると親セレクタを参照できる<br>
 <span class="bikou">この尾行欄につけている「※」印は「.bikou:before」ではなく「&:before」だけで済んでいる。 </span>
</p>
  </section>
</section>
              
            
!

CSS

              
                #scss h1 {
  color: red;
  font-size: 2em;
}

#scss .lede {
  font-size: 0.8em;
}

#nest, 
#oya {
  background: #eee;
  padding: 20px;
  margin: 0 0 20px;
  h2 {
    color: blue;
    font-size: 1.5em;
    line-height: 1.2;
    }
  p {
    em {
      font-weight: bold;
      color: brown;
    }
.bikou {
font-size: 0.8em;
&:before {
    content: "※";
}
}
  }
}



              
            
!

JS

              
                
              
            
!
999px

Console