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.


    .mondrian__block(v-for="block in blocks", :data-row-span="block.rowSpan", :data-col-span="block.colSpan", :data-color-index="block.colorIndex")
  button.generate-button(v-on:click='regenerate') Regenerate


                @import url(',900')

$mondrian-black = rgb(7, 9, 8)
$mondrian-yellow = rgb(248, 217, 45)
$mondrian-white = rgb(242, 245, 241)
$mondrian-blue = rgb(11, 84, 164)
$mondrian-red = rgb(214, 0, 20)

$colors = $mondrian-white $mondrian-yellow $mondrian-white $mondrian-blue $mondrian-white $mondrian-red

$blockSize = 50px
$height = 6 * $blockSize
$width = 5 * $blockSize

  box-sizing border-box
  animation  fadeIn .5s

  background-color #fff
  display grid
  align-items center
  justify-content center
  font-family 'Lato', sans-serif
  text-align       center
  padding 20px
  min-height 100vh
  width 100vw

  background-color $mondrian-black
  border 10px solid $mondrian-black
  box-shadow 5px 10px 10px #aaa
  display grid
  grid-auto-columns $blockSize
  grid-auto-flow dense
  grid-auto-rows $blockSize
  grid-gap 10px
  grid-template-columns repeat(auto-fit, $blockSize)
  grid-template-rows repeat(auto-fit, $blockSize)
  height $height
  overflow hidden
  width $width

    animation scaleIn .25s ease 0s
    background-color $mondrian-white

    for $block in (1..10)
        animation-delay $block * 0.15s
        background-color $color
        transform scale(0)
        animation-fill-mode forwards

    for $modifier in (1..3)
        grid-row span $modifier
        grid-column span $modifier

    for $colorIndex in (1..6)
        background-color $colors[$colorIndex - 1]

  cursor pointer
  padding 4px 12px
  border-radius 4px
  font-family 'Lato', sans-serif
  margin-top 30px
  background-color #fff

    background-color darken(#fff, 10%)
    background-color darken(#fff, 20%)

@keyframes scaleIn
    transform scale(0)
    transform scale(1)

@keyframes fadeIn
    opacity 0
    opacity 1


                const app = new Vue({
  el: '#app',
  data: {
    blocks: [],
  methods: {
    generateBlocks: function() {
      for (let i = 0; i < 10; i++) {
          colSpan: Math.floor(Math.random() * 3 + 1),
          rowSpan: Math.floor(Math.random() * 3 + 1),
          colorIndex: Math.floor(Math.random() * 6 + 1),
    regenerate: function() {
      this.blocks = []
      setTimeout(() => this.generateBlocks(), 0)
  mounted: function () {