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="postcss">
  <h1>PostCSS事始め</h2>
  <p class="lede">CodepenのSettingの旅CSS編の最終回。「次のCSS」とは一体何か?<br>
    PostCSSは新し目のメタ言語で、LESSやSASSと同じようなことができるがコンセプトは少し違うようだ。
</p>
  <ul>
    <li>処理がかなり高速</li>
    <li>必要な機能をプラグインで加えていく</li>
    <li>プラグインは個人が自由に作ることができるため、様々な種類が公開されている。</li>
    <li>cssnextなどのプラグインは将来W3Cが採択する予定の記法を先取りして使用できる。</li>
  </ul>
  <p>プラグインは「@use hogehoge;」という感じで入れるようだ。</p>
  
<section id="nested">
  <h2>nested</h2>
  <p>SASSやLESSのようにネストでかけるプラグイン。&で繋ぐ。</p>
</section>

<section id="cssnext">
  <h2>cssnext</h2>
  <p>W3Cが将来採用する予定の書き方ができる。例えば変数は「:root」で設定して「var(--hoge);」に適用される。<br>
    LESSは@、SASSは$だが将来的には--になりそう。
  </p>
</section>
    
    
</section>
              
            
!

CSS

              
                @use postcss-cssnext;
@use postcss-nested;

:root {
  --h2cl: blue;
}

#postcss h1 {
  font-size: 40px;
  color: red;
}

#nested {
  background: #eee;
  padding: 10px;
  margin: 0 0 10px;
  & h2 {
    color: blue;
  }
}

#cssnext {
  background: #eee;
  padding: 10px;
  margin: 0 0 10px;
  & h2 {
  color: var(--h2cl);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console