Pen Settings



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


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


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.


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.


                <a href="#" class="btn btn-default">Button default</a>

<a href="#" class="btn btn-primary">Button primary</a>

<a href="#" class="btn btn-danger">Button danger</a>


                @import "compass/css3";

// 定義按鈕的基本色彩
$brand-primary: #009AFF;
$brand-danger: #D84315;

// 定義按鈕的不同狀態設定,類似json格式
		class: 'default',
		color: #333,
		bg: #fff,
		border-color: #ccc
		class: 'primary',
		color: #fff,
		bg: $brand-primary,
		border-color: darken($brand-primary, 0)
		class: 'danger',
		color: #fff,
		bg: $brand-danger,
		border-color: darken($brand-danger, 0)

// 通用的按鈕class
.btn {
  display: inline-block;
  margin-bottom: 0; 
  text-align: center;
  vertical-align: middle;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;

// 用$each 帶入設定值
@each $name, $value in $btn-config {
  $class: map-get($value, class); // 用map-get取出各個設定值
  $color: map-get($value, color);
  $bg: map-get($value, bg);
  $border-color: map-get($value, border-color);
  // 接下來將變數加到class內就完成了
    color: $color;
    background-color: $bg;
    border-color: $border-color;
      background-color: darken($bg, 5%);
      border-color: darken($border-color, 5%);