Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!-- wrapper for bricky -->
<div class="bricky"></div>

<!-- lots of articles -->
<article>
  <h2>1. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amcto molestias fugit quis vel ipsum omnis!</p>
</article>
<article>
  <h2>2. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione harum, laboriosam maiores ducimus minima repudiandae delectus maxime voluptatibus voluptate facere soluta ipsam beatae provident. Est minima, natus explicabo eaque dicta nemo suscipit deleniti cumque culpa itaque et, alias laborum autem!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum pariatur in at quidem adipisci veniam mollitia, voluptates placeat eligendi assumenda alias, quo deleniti maiores autem! Quaerat, eius fugit exercitationem consequuntur.</p>
</article>
<article>
  <h2>3. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus reiciendis placeat magni quae quasi aut magnam accusamus ex. Quisquam voluptate, ipsam velit a excepturi eaque laboriosam dolorem suscipit fuga officiis odit perspiciatis magni impedit porro non accusantium recusandae, quia sequi assumenda sed vero officia veritatis. Inventore repellendus vitae porro veritatis.</p>
</article>
<article>
  <h2>4. Lorem ipsum dolor.</h2>
  <p>As enim recusandae, modi accusantium quaerat nemo saepe! Cupiditate fuga tenetur facilis cum quod est obcaecati, ipsam nesciunt vel earum veritatis at sequi soluta inventore, modi, aspernatur. Ad, odio!</p>
</article>
<article>
  <h2>5. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum, consequatur. Dolorem debitis earum, necessitatibus doloremque architecto provident magnam quaerat quidem sed. Molestias reprehenderit sunt quod adipisci mollitia est, delectus quo corporis ipsa odio dignissimos repellendus numquam, suscipit at perspiciatis ut nulla? Enim nulla, distinctio illo ut maiores itaque alias ea error eos, unde quaerat optio, architecto molestias reiciendis obcaecati saepe.</p>
</article>
<article>
  <h2>6. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel ullam recusandae sed dolor corporis id exercitationem earum. Corporis voluptatum rerum at. Mollitia suscipit eum veritatis maxime quaerat vitae. Deleniti accusantium modi fugiat dolor delectus eveniet commodi quidem quia tenetur repudiandae doloribus ipsa eius, harum enim rem minus corporis porro. Totam atque, quas ipsum placeat cumque vero laudantium culpa enim excepturi, voluptas velit deleniti odit, expedita illo quibusdam! Sit, mollitia, corporis.</p>
</article>
<article>
  <h2>7. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima perspiciatis, aperiam molestias consequatur. Aperiam nostrum porro fuga quisquam praesentium blanditiis commodi doloribus quia quos atque, soluta vero voluptatem amet odit ad excepturi recusandae. Repellendus culpa voluptas modi a sit eligendi ad aspernatur cupiditate amet sunt eveniet, soluta maxime, fugit earum. Cum vero natus dolores labore maiores neque iste animi veniam, iusto veritatis! Iste necessitatibus, blanditiis! Cumque quis facere, maiores reiciendis eius, fugit laborum quisquam facilis ipsam, quia fuga nam reprehenderit!</p>
</article>
<article>
  <h2>8. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fuga quas quis ipsam autem eius aspernatur doloribus eum sit reiciendis unde! Veritatis, esse rerum hic neque nisi repellendus saepe at quasi cum, quod aperiam maiores molestias optio repudiandae accusamus nobis quidem. Ipsum corporis deserunt aspernatur ab, modi aperiam repudiandae voluptatibus iste recusandae. Temporibus ratione, nam. Earum natus saepe animi, unde et dolorum necessitatibus error accusantium repellat odio, ducimus quos soluta vitae eligendi quod voluptates debitis expedita laborum nihil dolorem repudiandae laudantium. Cum porro labore ullam eaque eos, inventore, reiciendis soluta molestiae.</p>
</article>
<article>
  <h2>9. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Exercitationem quo, placeat id, neque perferendis debitis voluptatum fugiat, reiciendis, dolores rerum reprehenderit est. Aut sequi hic repudiandae accusamus cupiditate laboriosam repellat, culpa, excepturi voluptatum repellendus vero perferendis vitae ab! Tenetur, vitae quisquam. Architecto reiciendis explicabo unde hic nemo incidunt impedit molestias dignissimos voluptas. Ullam ex laudantium, quaerat, perspiciatis sit nostrum laboriosam perferendis omnis voluptates blanditiis sint nemo vitae commodi veritatis magni amet! Unde possimus amet dignissimos nam. Hic error quibusdam a quis repellat officia! Dignissimos, repudiandae, nihil! Aperiam neque dolorum in sed accusantium sunt veniam hic consectetur, magnam, dolore animi eveniet!</p>
</article>
<article>
  <h2>10. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, exercitationem, suscipit. Ducimus iste minima facilis suscipit harum, dolorem eos mollitia.</p>
</article>
<article>
  <h2>11. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laboriosam corporis totam placeat nam odio hic ex neque suscipit accusantium a iusto quae autem velit est delectus possimus, error, cumque modi.</p>
</article>
<article>
  <h2>12. Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit, praesentium! Aut mollitia qui error ducimus impedit, odit laborum veniam necessitatibus! Dolorem, nihil, ut rem, consectetur ex dicta a nisi autem voluptatem, temporibus eius. Nemo sequi minus accusamus adipisci animi similique!</p>
</article>
            
          
!
            
              @keyframes show {
  0% {
    transform: scale(.9);
    opacity: 0;
  }

  100% {
    transform: none;
    opacity: 1;
  }
}

* {
  margin: 0;
  box-sizing: border-box;
}

body {
  margin: 12px;
  background: hsla(0, 0%, 90%, 1);
  color: #555;
  font-family: sans-serif;
  font-size: 85%;
  line-height: 1.6;
}

img {
  max-width: 100%;
}

article {
  margin-bottom: 12px;
  background: #fff;
  animation-name: show;
  animation-duration: 250ms;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(.17, .67, .52, 1.25);
  box-shadow: inset 0 0 0 1px hsla(0, 0%, 93%, 1);
}

h2 {
  padding: 1.5rem 1.5rem 0;
  color: #000;
  font-size: 1.1rem;
}

p {
  padding: 1.5rem;
}

            
          
!
            
              // This is minified Bricky
!function(){var e=function(e){var t={parent:e.parent,elements:e.elements,gutter:e.gutter||"1rem",breakpoints:e.breakpoints||[[600,2],[900,3],[1200,4]]};this.parent=document.querySelector(t.parent),this.collectItems=function(){var e=[],r=document.querySelectorAll(t.elements);return[].forEach.call(r,function(t){e.push(t),t.parentNode.removeChild(t)}),e},this.brickyItems=this.collectItems(),this.clearParent=function(){this.parent.innerHTML=""},this.render=function(){function e(){for(var e=window.outerWidth,r=t.breakpoints,n=r.sort(function(e,t){return t[0]-e[0]}),i=0;i<n.length;i++)if(e>n[i][0])return n[i][1];return 1}function r(){for(var e=n.querySelectorAll("div"),t=[],r=0;r<e.length;r++){for(var i=0,l=0;l<e[r].querySelectorAll("*").length;l++)i+=e[r].querySelectorAll("*")[l].clientHeight;t.push(i)}return t.indexOf(Math.min.apply(Math,t))}this.clearParent();var n=document.createElement("div");n.style.display="-webkit-box",n.style.display="-webkit-flex",n.style.display="-ms-flexbox",n.style.display="flex",this.parent.appendChild(n);for(var i=e(),l=0;i>l;l++){var o=document.createElement("div");o.style.width=100/i+"%",l!==i-1&&(o.style.marginRight=t.gutter),n.appendChild(o)}for(var a=0;a<this.brickyItems.length;a++){var s=r();n.querySelectorAll("div")[s].appendChild(this.brickyItems[a])}},this.debounce=function(e,t,r){var n=0;return function(){var i=this,l=arguments,o=function(){n=null,r||e.apply(i,l)},a=r&&!n;clearTimeout(n),n=setTimeout(o,t||200),a&&e.apply(i,l)}},this.start=function(){window.addEventListener("load",this.render());var e=this;window.addEventListener("resize",e.debounce(function(){e.render()},200))}};"undefined"!=typeof module&&module.exports?module.exports=e:window.Bricky=e}();

// Custom settings
var pref = {
  parent: '.bricky',
  elements: 'article',
  gutter: '12px',
  breakpoints: [
    [400, 2],
    [600, 3],
    [800, 4]
  ]
};

// Instatntiate new Bricky and trigger start method
var mySuperLayout = new Bricky(pref);
mySuperLayout.start();
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console