sass - multi-nested css flex does not flex properly -


i'm doing mockup using html , scss (or sass?). goal have page > container > [header + article container] articles displayed in grid.

i have tossed out div-nade , let shrapnel of div#id land may, instead decided use css flex , having problems. know , understand properties , parameters, can't seem them right.

how make there's limited number of items per row , and wraps next row?

here's pen: http://codepen.io/monsto/pen/ekazm

here's html:

<body>  body flex   <div class="main">    .main     <header class="header">      .header      <nav>        nav      </nav>    </header>     <section class="pack">      section       <article class="item text">        article         <div class="item-content">           <header class="entrytitle">a guy walks bar</header>           <p></p>          <p></p>          <p></p>          <p></p>         </div>       </article>  <!-- copy <article> many times samples -->     </section>   </div> </body> 

and sass (or scss?). commented stuff troubleshoot.

$bg: #eec; $bord: #aaa;  @mixin colorize {   $bg: darken($bg,8%);   background-color: $bg;   $bord: darken($bord,10%);   border-color: $bord; }  @mixin flex-spec {   display: flex;   //flex: 1;   flex-flow: row wrap;   justify-content: space-between; }  * {box-sizing: border-box;}  html {  z-index: -10; }  /*body {   border:none;    background-color: #444;   overflow: auto; }*/  body * {   // affects children of body   font: bold 16px arial;   border-radius: 8px;   // flex: 1;   border: 5px solid $bord;   @include colorize;   //margin: 4px; padding: 0px; }  div.main {   @include colorize;   margin: 0; padding: 0;    header.header {     @include colorize;     nav {       @include colorize;     }   }    section {     @include colorize;     padding: 2px;     article {       @include colorize;       * {border: none; border-radius: 1px;}       div.item-content {         @include colorize;         border: 1px solid white;         //margin: 0;         header {//margin: 0;           @include colorize;         }         p {height: 10px; margin: 0 0 10px;}       }       &.embiggen {         align-items: stretch;         background: #ffb; border-color: black;          height: 394px; width: 100%; margin: 0px; padding: 0px;         position: relative; z-index: 10;       }     }   } } 


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -