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

              
                //- All Thanks to Holy Javascript and me

//- Core code for all mixins, you must put this code in some file and include on you need

mixin mixin-block(name)
  //- this mixin set named block data to some global scope
  - global.maxinData = global.maxinData || {}
  - global.mixinCallId = global.mixinCallId || 0
  - global.maxinData[global.mixinCallId] = global.maxinData[global.mixinCallId] || {}
  if block
    - global.maxinData[global.mixinCallId][name] = () => block()

mixin mixin-block-exists(name)
  //- Checking if named data exists and displaying block
  - global.maxinDataExists = global.maxinDataExists || function(name) { return global.maxinData !== undefined && global.maxinData[global.mixinCallId] !== undefined && global.maxinData[global.mixinCallId][name] !== undefined; }
  if block && global.maxinDataExists(name)
    block
    
mixin mixin-block-get(name)
  //- Displaying block if exists
  if global.maxinData !== undefined && global.mixinCallId !== undefined
    if global.maxinData[global.mixinCallId]
      if global.maxinData[global.mixinCallId][name]
        - global.maxinData[global.mixinCallId][name]()

mixin mixin-next
  //- Switching to next
  - global.mixinCallId = (global.mixinCallId || 0) + 1;
  
//- End of core code


//- Example of usage

//- Let put all together and create some mixin
mixin title-block
  //- Important! We have to execute out block code first
  block
  //- Wrappers goes there if you need them
  .title-block
    //- Checking if named block data exists
    +mixin-block-exists("title")
      h3
        //- Displaying block data
        +mixin-block-get("title")
    +mixin-block-exists("sub-title")
      p
        +mixin-block-get("sub-title")
  //- Important! Switching helps to avoid data overlaping
  +mixin-next()
  
//- Using our mixin

+title-block()
  //- Avoid using tags for wrapping content, use only named blocks
  +mixin-block("title")
    | Blabl title 1
  +mixin-block("sub-title")
    | Blabla sub title 1

+title-block()
  +mixin-block("title")
    | Blabl title 2

+title-block()
  +mixin-block("sub-title")
    | Blabla sub title 3
              
            
!

CSS

              
                .title-block {
  margin: 15px;
  padding: 15px;
  border: 1px dashed lightgrey;
}
              
            
!

JS

              
                
              
            
!
999px

Console