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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="principal">
  
<!--*****************************
     PROPIEDADES DEL CONTENEDOR
    ***************************** -->
  
  <h2>Properties for the flex container</h2>
  <!-- FLEX-DIRECTION -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-direction.php">flex-direction: (default "row")</a></h4>
    <p class="description">Establece el eje principal del contenedor y su sentido</p>
    <div class="radio">
      <input name="flex-direction" type="radio" class="flex-direction" id="R11" value="row" checked><label for="R11">row:</label>
      <input name="flex-direction" type="radio" class="flex-direction" id="R12" value="row-reverse"><label for="R12">row-reverse:</label>
      <input name="flex-direction" type="radio" class="flex-direction" id="R13" value="column"><label for="R13">column:</label>
      <input name="flex-direction" type="radio" class="flex-direction" id="R14" value="column-reverse"><label for="R14">column-reverse:</label>
    </div>
  </div>
  <div class="flex-container" id="direction">
    <div class="item" data-color="2a80b9">
      <p>1</p>
    </div>
    <div class="item" data-color="8f44ad">
      <p>2</p>
    </div>
    <div class="item" data-color="16a086">
      <p>3</p>
    </div>
    <div class="item" data-color="f1c40f">
      <p>4</p>
    </div>
    <div class="item" data-color="e77e23">
      <p>5</p>
    </div>
  </div>


  <!--FLEX-WRAP-->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-wrap.php">flex-wrap: (default "nowrap")</a></h4>
    <p class="description">Determina la existencia o no de saltos de línea y su sentido </p>
    <div class="radio">
      <input name="flex-wrap" type="radio" class="flex-wrap" id="R21" value="nowrap" checked><label for="R21">nowrap:</label>
      <input name="flex-wrap" type="radio" class="flex-wrap" id="R22" value="wrap"><label for="R22">wrap:</label>
      <input name="flex-wrap" type="radio" class="flex-wrap" id="R23" value="wrap-reverse"><label for="R23">wrap-reverse:</label>
    </div>
  </div>
  <div class="flex-container" id="wrap">
    <div class="item" data-color="2a80b9">
      <p>1</p>
    </div>
    <div class="item" data-color="8f44ad">
      <p>2</p>
    </div>
    <div class="item" data-color="16a086">
      <p>3</p>
    </div>
    <div class="item" data-color="f1c40f">
      <p>4</p>
    </div>
    <div class="item" data-color="e77e23">
      <p>5</p>
    </div>
  </div>


  <!--JUSTIFY-CONTENT -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-justify-content.php">justify-content: (default "flex-start")</a></h4>
    <p class="description">Establece la alineación de los items en el eje principal (reparto del espacio)</p>
    <div class="radio">
      <input name="justify-content" type="radio" class="justify-content" id="R41" value="justify-start" checked><label for="R41">flex-start:</label>
      <input name="justify-content" type="radio" class="justify-content" id="R42" value="justify-end"><label for="R42">flex-end:</label>
      <input name="justify-content" type="radio" class="justify-content" id="R43" value="justify-space-between"><label for="R43">space-between:</label>
      <input name="justify-content" type="radio" class="justify-content" id="R44" value="justify-center"><label for="R44">center:</label>
      <input name="justify-content" type="radio" class="justify-content" id="R45" value="justify-space-around"><label for="R45">space-around:</label>
    </div>
  </div>
  <div class="flex-container" id="justify">
    <div class="item" data-color="2a80b9">
      <p>1</p>
    </div>
    <div class="item" data-color="8f44ad">
      <p>2</p>
    </div>
    <div class="item" data-color="16a086">
      <p>3</p>
    </div>
    <div class="item" data-color="f1c40f">
      <p>4</p>
    </div>
    <div class="item" data-color="e77e23">
      <p>5</p>
    </div>
  </div>
  
  <!-- ALIGN-ITEMS -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-align-items.php">align-items: (default "stretch")</a></h4>
    <p class="description">Establece la alineación de los items en el eje transversal (reparto del espacio)</p>
    <div class="radio">
      <input name="flex-align-items" type="radio" class="flex-align-items" id="R31" value="align-items-start"><label for="R31">flex-start:</label>
      <input name="flex-align-items" type="radio" class="flex-align-items" id="R32" value="align-items-end"><label for="R32">flex-end:</label>
      <input name="flex-align-items" type="radio" class="flex-align-items" id="R33" value="align-items-center"><label for="R33">center:</label>
      <input name="flex-align-items" type="radio" class="flex-align-items" id="R34" value="align-items-baseline"><label for="R34">baseline:</label>
      <input name="flex-align-items" type="radio" class="flex-align-items" id="R35" value="align-items-stretch" checked><label for="R35">stretch:</label>
    </div>
  </div>
  <div class="flex-container" id="align">
    <div class="item" data-color="2a80b9">
      <p>1</p>
    </div>
    <div class="item" data-color="8f44ad">
      <p>2</p>
    </div>
    <div class="item" data-color="16a086">
      <p style="font-size:50px;">3</p>
    </div>
    <div class="item" data-color="f1c40f">
      <p>4</p>
    </div>
    <div class="item" data-color="e77e23">
      <p>5</p>
    </div>
  </div>
  
  <!--ALIGN-CONTENT -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-align-content.php">align-content: (default "stretch")</a></h4>
    <p class="description">(IMPORTANTE!!! SOLO CON MÁS DE UNA LÍNEA) Alineación de FILAS respecto del eje transversal</p>
    <div class="radio">
      <input name="align-content" type="radio" class="align-content" id="R51" value="align-content-start"><label for="R51">flex-start:</label>
      <input name="align-content" type="radio" class="align-content" id="R52" value="align-content-end"><label for="R52">flex-end:</label>
      <input name="align-content" type="radio" class="align-content" id="R53" value="align-content-center"><label for="R53">center:</label>
      <input name="align-content" type="radio" class="align-content" id="R54" value="align-content-space-between"><label for="R54">space-between:</label>
      <input name="align-content" type="radio" class="align-content" id="R55" value="align-content-space-around"><label for="R55">space-around:</label>
      <input name="align-content" type="radio" class="align-content" id="R56" value="align-content-stretch" checked><label for="R56">stretch:</label>
    </div>
  </div>
  <div class="flex-container" id="alignContent">
    <div class="item" data-color="1bbc9d">
      <p>1</p>
    </div>
    <div class="item" data-color="2fcc71">
      <p>2</p>
    </div>
    <div class="item" data-color="3598dc">
      <p>3</p>
    </div>
    <div class="item" data-color="9c59b8">
      <p>4</p>
    </div>
    <div class="item" data-color="34495e">
      <p>5</p>
    </div>
    <div class="item" data-color="16a086">
      <p>6</p>
    </div>
    <div class="item" data-color="27ae61">
      <p>7</p>
    </div>
    <div class="item" data-color="2a80b9">
      <p>8</p>
    </div>
    <div class="item" data-color="8f44ad">
      <p>9</p>
    </div>
    <div class="item" data-color="2d3e50">
      <p>10</p>
    </div>
    <div class="item" data-color="f1c40f">
      <p>11</p>
    </div>
    <div class="item" data-color="e77e23">
      <p>12</p>
    </div>
    <div class="item" data-color="e84c3d">
      <p>13</p>
    </div>
    <div class="item" data-color="ecf0f1">
      <p>14</p>
    </div>
    <div class="item" data-color="96a6a6">
      <p>15</p>
    </div>
    <div class="item" data-color="f49c14">
      <p>16</p>
    </div>
    <div class="item" data-color="d55401">
      <p>17</p>
    </div>
    <div class="item" data-color="c1392b">
      <p>18</p>
    </div>
    <div class="item" data-color="bec3c7">
      <p>19</p>
    </div>
    <div class="item" data-color="808b8d">
      <p>20</p>
    </div>
  </div>
  
</div>

<!--*****************************
     PROPIEDADES DE LOS ITEMS
    ***************************** -->

<div class="principal">
  <h2>Properties for the flex items </h2>
  
  <!-- ALIGN-SELF -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-align-self.php">align-self: (default "auto")</a></h4>
    <p class="description">"Sobreescribe" la propiedad ALIGN-ITEMS para el elemento</p> 
    <div class="radio">
      <input name="align-self" type="radio" class="align-self" id="R61" value="align-self-auto" checked><label for="R61">auto:</label>
      <input name="align-self" type="radio" class="align-self" id="R62" value="align-self-start"><label for="R62">flex-start:</label>
      <input name="align-self" type="radio" class="align-self" id="R63" value="align-self-end"><label for="R63">flex-end:</label>
      <input name="align-self" type="radio" class="align-self" id="R64" value="align-self-center"><label for="R64">center:</label>
      <input name="align-self" type="radio" class="align-self" id="R65" value="align-self-baseline"><label for="R65">baseline:</label>
      <input name="align-self" type="radio" class="align-self" id="R66" value="align-self-stretch"><label for="R66">stretch:</label>
    </div>
  </div>
  <div class="flex-container align-items-center" id="FCI1">
    <div class="item" data-color="f49c14">
      <p>1</p>
    </div>
    <div class="item" data-color="d55401">
      <p>2</p>
    </div>
    <div class="item" data-color="c1392b" id="alignSelf">
      <p style="font-size:50px;">3</p>
    </div>
    <div class="item" data-color="bec3c7">
      <p>4</p>
    </div>
    <div class="item" data-color="808b8d">
      <p>5</p>
    </div>
  </div>

  
  <!-- FLEX-GROW -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-abreviado.php#flexGrow">flex-grow: (default "0")</a></h4>
    <p class="description">SI HAY ESPACIO SOBRANTE Indica lo que puede crecer un elemento para ocuparlo.</p>
<p class="description">El número indica la proporción en la que se lo reparten.-> NO QUE VAYA A SER EL DOBLE QUE EL OTRO, SINO QUE VA A RECIBIR EL DOBLE DEL ESPACIO VACÍO</p>
  <p class="description">Por defecto, no crecen (0)</p> 
    <div class="radio">
      <span class="nbsp"><label for="R71">elemento 1: </label><input type="number"  class="flex-grow" id="R71" min="0" ></span>
      <span class="nbsp"><label for="R72">elemento 2: </label><input type="number"  class="flex-grow" id="R72" min="0" ></span>
      <span class="nbsp"><label for="R73">elemento 3: </label><input type="number"  class="flex-grow" id="R73" min="0" ></span>
      <span class="nbsp"><label for="R74">elemento 4: </label><input type="number"  class="flex-grow" id="R74" min="0" ></span>
      <span class="nbsp"><label for="R75">elemento 5: </label><input type="number"  class="flex-grow" id="R75" min="0" ></span>
    </div>
  </div>
  <div class="flex-container align-items-center" id="FCI2">

    <div class="item" id="itemR71" data-color="f49c14">
      <p>1</p>
    </div>
    <div class="item" id="itemR72" data-color="d55401">
      <p>2</p>
    </div>
    <div class="item" id="itemR73" data-color="c1392b">
      <p>3</p>
    </div>
    <div class="item" id="itemR74" data-color="bec3c7">
      <p>4</p>
    </div>
    <div class="item" id="itemR75" data-color="808b8d">
      <p>5</p>
    </div>
  </div>

  <!-- FLEX-SHRINK -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-abreviado.php#flexShrink">flex-shrink: (DEFAULT "1")</a></h4>
    <p class="description">SI HAY DESBORDAMIENTO establece mi capacidad de "encoger". Por defecto, encogen (1).</p>
    <div class="radio">
      <span class="nbsp"><label for="R81">elemento 1: </label><input type="number"  class="flex-shrink" id="R81" min="0" ></span>
      <span class="nbsp"><label for="R82">elemento 2: </label><input type="number"  class="flex-shrink" id="R82" min="0" ></span>
      <span class="nbsp"><label for="R83">elemento 3: </label><input type="number"  class="flex-shrink" id="R83" min="0" ></span>
      <span class="nbsp"><label for="R84">elemento 4: </label><input type="number"  class="flex-shrink" id="R84" min="0" ></span>
      <span class="nbsp"><label for="R85">elemento 5: </label><input type="number"  class="flex-shrink" id="R85" min="0" ></span>
    </div>

  </div>
  <div class="flex-container align-items-center" id="FCI3">
    <div class="item" id="itemR81" data-color="f49c14">
      <p>1</p>
    </div>
    <div class="item" id="itemR82" data-color="d55401">
      <p>2</p>
    </div>
    <div class="item" id="itemR83" data-color="c1392b">
      <p>3</p>
    </div>
    <div class="item" id="itemR84" data-color="bec3c7">
      <p>4</p>
    </div>
    <div class="item" id="itemR85" data-color="808b8d">
      <p>5</p>
    </div>
  </div>
  
  
  <!-- FLEX: SHORTHAND -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-basis.php">flex-basis: (DEFAULT "AUTO")</a></h4>
    <p>Tiene poco sentido sin flex-shrink y flex-grow, sobreescribiría el valor width si lo hubiera. </p>
</div>
    
  <!-- FLEX: SHORTHAND -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-abreviado.php">flex: SHORTHAND (DEFAULT "0 1 AUTO")</a></h4>
    <p>.item { flex: flex-grow [flex-shrink] [flex-basis]; } </p>
    <table id="flexBasis">
      <tr>
        <td>elemento 1</td>
        <td>elemento 2</td>
      </tr>
      <tr>
        <td><input type="number" class="flex-basis" id="B1" min="0" value="200"><label for="B1">flex-basis px</label></td>
        <td><input type="number" class="flex-basis" id="B2" min="0" value="200"><label for="B2">flex-basis px</label></td>
      </tr>
      <tr>
        <td><input type="number" class="flex-basis-grow" id="G1" min="0" value="0"><label for="G1">flex-grow</label></td>
        <td><input type="number" class="flex-basis-grow" id="G2" min="0" value="0"><label for="G2">flex-grow</label></td>
      </tr>
      <tr>
        <td><input type="number" class="flex-basis-shrink" id="S1" min="0" value="0"><label for="S1">flex-shrink</label></td>
        <td><input type="number" class="flex-basis-shrink" id="S2" min="0" value="0"><label for="S2">flex-shrink</label></td>
      </tr>
    </table>
  </div>
  <div class="flex-container align-items-center" id="FCI4">
    <div class="item" id="item1" data-color="f49c14">
      <p>1</p>
    </div>
    <div class="item" id="item2" data-color="d55401">
      <p>2</p>
    </div>

  </div>


 <!-- ORDER -->
  <div class="control">
    <h4><a target="_blank" href="http://w3.unpocodetodo.info/css3/flex-order.php">order: (DEFAULT "0")</a></h4>
  <p>Cambia el orden de colocación que correspondería según su orden en el HTML.</p>
  <p>(Regla mnemotécnica -> pensad en como funciona z-index) Valores positivos y negativos. Positivos colocan AL FINAL DE LA PILA, negativos AL PRINCIPIO.</p>
    <div class="radio">
      <span class="nbsp"><label for="R91">elemento 1: </label><input type="number"  class="flex-order" id="R91"></span>
      <span class="nbsp"><label for="R92">elemento 2: </label><input type="number"  class="flex-order" id="R92"></span>
      <span class="nbsp"><label for="R93">elemento 3: </label><input type="number"  class="flex-order" id="R93"></span>
      <span class="nbsp"><label for="R94">elemento 4: </label><input type="number"  class="flex-order" id="R94"></span>
      <span class="nbsp"><label for="R95">elemento 5: </label><input type="number"  class="flex-order" id="R95"></span>
    </div>

  </div>
  <div class="flex-container align-items-center" id="FCI5">


    <div class="item" id="orderR91" data-color="f49c14">
      <p>1</p>
    </div>
    <div class="item" id="orderR92" data-color="d55401">
      <p>2</p>
    </div>
    <div class="item" id="orderR93" data-color="c1392b">
      <p>3</p>
    </div>
    <div class="item" id="orderR94" data-color="bec3c7">
      <p>4</p>
    </div>
    <div class="item" id="orderR95" data-color="808b8d">
      <p>5</p>
    </div>

  </div>


</div>
              
            
!

CSS

              
                .flex-container {
 border: 1px solid #555;
 display : -ms-flexbox;
 display : flex;
 padding:20px;
 width:100%; 
 }
.item{
	margin:0; 
    display : inherit;
	padding:10px; 
	width:100px; 
	height:100px;
	-webkit-align-items: center;
	-ms-flex-align:center;
	align-items: center;
	}
/*flex-direction: row | row-reverse | column | column-reverse;*/

.flex-container.row {
  flex-direction: row;
}

.flex-container.row-reverse {
  flex-direction: row-reverse;
}

.flex-container.column {
  flex-direction: column;
}

.flex-container.column-reverse {
  flex-direction: column-reverse;
}


/*flex-wrap: nowrap | wrap | wrap-reverse;*/

.flex-container.nowrap {
  flex-wrap: nowrap;
}

.flex-container.wrap {
  flex-wrap: wrap;
}

.flex-container.wrap-reverse {
  flex-wrap: wrap-reverse;
}


/*align-items: flex-start | flex-end | center | baseline | stretch;*/

.flex-container.align-items-start {
  -ms-flex-align: start;
  align-items: flex-start;
}

.flex-container.align-items-end {
  -ms-flex-align: end;
  align-items: flex-end;
}

.flex-container.align-items-center {
  -ms-flex-align: center;
  align-items: center;
}

.flex-container.align-items-baseline {
  -ms-flex-align: baseline;
  align-items: baseline;
}

.flex-container.align-items-stretch {
  -ms-flex-align: stretch;
  align-items: stretch;
}


/*justify-content: flex-start | flex-end | center | space-between | space-around;*/

.flex-container.justify-start {
  -ms-flex-pack: start;
  justify-content: flex-start;
}

.flex-container.justify-end {
  -ms-flex-pack: end;
  justify-content: flex-end;
}

.flex-container.justify-center {
  -ms-flex-pack: center;
  justify-content: center;
}

.flex-container.justify-space-between {
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.flex-container.justify-space-around {
  -ms-flex-pack: justify;
  justify-content: space-around;
}


/*align-content: flex-start | flex-end | center | space-between | space-around | stretch;*/

.flex-container.align-content-start {
  -ms-flex-line-pack: start;
  align-content: flex-start;
}

.flex-container.align-content-end {
  -ms-flex-line-pack: end;
  align-content: flex-end;
}

.flex-container.align-content-center {
  -ms-flex-line-pack: center;
  align-content: center;
}

.flex-container.align-content-space-between {
  -ms-flex-line-pack: justify;
  align-content: space-between;
}

.flex-container.align-content-space-around {
  -ms-flex-line-pack: justify;
  /*distribute;*/
  align-content: space-around;
}

.flex-container.align-content-stretch {
  -ms-flex-line-pack: stretch;
  align-content: stretch;
}


/*align-self: auto | flex-start | flex-end | center | baseline | stretch;*/

.item.align-self-auto {
  -ms-flex-item-align: auto;
  align-self: auto;
}

.item.align-self-start {
  -ms-flex-item-align: start;
  align-self: flex-start;
}

.item.align-self-end {
  -ms-flex-item-align: end;
  align-self: flex-end;
}

.item.align-self-center {
  -ms-flex-item-align: center;
  align-self: center;
}

.item.align-self-baseline {
  -ms-flex-item-align: baseline;
  align-self: baseline;
}

.item.align-self-stretch {
  -ms-flex-item-align: stretch;
  align-self: stretch;
}

.item.flex-grow1 {
  flex-grow: 1;
}

.item.flex-grow2 {
  flex-grow: 2;
}

.item.flex-grow3 {
  flex-grow: 3;
}

.item.flex-grow4 {
  flex-grow: 4;
}
html,body{ width:100%; min-height:100%; margin:0; padding:0; color:#ddd; font-size:14px; font-family:Verdana, Geneva, sans-serif;background-color:#333;}
.principal{ width:calc(50% - 40px); min-width:525px; margin:0 20px 20px 20px; float:left;}
.radio{ margin:20px 0;}
label{ line-height:200%;}
input[type=radio] { color:white; }
input[type=radio]:checked + label { color:orange; }
input[type=number]{ width:40px; margin-right:.5em;}
h1{ font-size:200%;margin:20px;}
h2{ font-size:180%;margin:0px;}
h4{ text-transform: uppercase; font-size: 1.1em; margin: 3em 0 .5em; font-weight: bold;}
table{ width:100%; margin-bottom:1em;}
table td{ width:50%; padding:3px;}
.principal:last-of-type h4 small{ color:#ff8080;}
.item p{width:100%; text-align:center; color:#fff;}
#direction .item{flex-wrap:wrap;}
/*#wrap .item{ height:auto;}*/
#wrap{ width:400px;}
#align .item{height:auto; height:auto;flex-wrap:wrap;}	
#align{ height:300px;}
#justify{ margin:20px 0; padding:20px 0;}
#alignContent{flex-wrap:wrap; height:600px;}
#alignContent .item{ height:auto;} 
#FCI1{ height:300px;}
#FCI1 .item{ height:auto;}
#FCI3 .item{ width:25%;}
#FCI4 .item{ width:200px;}
#FCI5 .item{ width:20%;}
#B1, #B2{
  width: 60px;
}
.nbsp{white-space: nowrap;}

@media only screen and (max-width:1100px){.principal{ width:calc(100% - 40px);}}
@media only screen and (max-width:580px) {
.item{ width:50px;height:50px;}
.principal{ width:calc(100% - 40px); min-width:initial;}
.flex-container{width:100%; min-width:initial;}	
#wrap{ width:200px;}
}

              
            
!

JS

              
                function changeFlex(e, t) {
  for (var n = document.querySelectorAll("." + e), l = document.querySelector("#" + t), r = 0; r < n.length; r++) n[r].addEventListener("change", function() {
    var e = this.value;
    l.setAttribute("class", "flex-container " + e)
  }, !1)
}

function changeItemFlex(e, t) {
  for (var n = document.querySelectorAll("." + e), l = document.querySelector("#" + t), r = 0; r < n.length; r++) n[r].addEventListener("change", function() {
    var e = this.value;
    l.setAttribute("class", "item " + e)
  }, !1)
}

function changeFlexBasis(e, t) {
  var n = isNaN(e.value) ? 0 : e.value;
  console.log("B: " + n), document.querySelector("#" + t).style.WebkitFlexBasis = n + "px", document.querySelector("#" + t).style.flexBasis = n + "px"
}

function changeFlexGrow(e, t) {
  var n = isNaN(e.value) ? 0 : e.value;
  console.log("G: " + n), document.querySelector("#" + t).style.WebkitFlexGrow = n, document.querySelector("#" + t).style.flexGrow = n
}

function changeFlexShrink(e, t) {
  var n = isNaN(e.value) ? 0 : e.value;
  console.log("S: " + n), document.querySelector("#" + t).style.WebkitFlexShrink = n, document.querySelector("#" + t).style.flexShrink = n
}

function changeFlexOrder(e, t) {
  var n = isNaN(e.value) ? 0 : e.value;
  console.log("O: " + n), document.querySelector("#" + t).style.WebkitOrder = n, document.querySelector("#" + t).style.order = n
}

function changeAll(e, t, n, l) {
  changeFlexBasis(e, l), changeFlexGrow(t, l), changeFlexShrink(n, l)
}
for (var items = document.querySelectorAll(".item"), i = 0; i < items.length; i++)
  if (items[i].hasAttribute("data-color")) {
    var color = items[i].getAttribute("data-color");
    items[i].style.backgroundColor = "#" + color
  }
for (var flexO = document.querySelectorAll(".flex-order"), o = 0; o < flexO.length; o++) flexO[o].addEventListener("change", function() {
  changeFlexOrder(this, "order" + this.id)
}, !1);
changeFlex("flex-direction", "direction"), changeFlex("flex-wrap", "wrap"), changeFlex("flex-align-items", "align"), changeFlex("justify-content", "justify"), changeFlex("align-content", "alignContent"), changeItemFlex("align-self", "alignSelf");
for (var flexGrow = document.querySelectorAll(".flex-grow"), i = 0; i < flexGrow.length; i++) flexGrow[i].addEventListener("change", function() {
  var e = "item" + this.id;
  changeFlexGrow(this, e)
});
for (var flexShrink = document.querySelectorAll(".flex-shrink"), j = 0; j < flexShrink.length; j++) flexShrink[j].addEventListener("change", function() {
  var e = "item" + this.id;
  changeFlexShrink(this, e)
});
var B1 = document.querySelector("#B1"),
  G1 = document.querySelector("#G1"),
  S1 = document.querySelector("#S1"),
  B2 = document.querySelector("#B2"),
  G2 = document.querySelector("#G2"),
  S2 = document.querySelector("#S2");
B1.addEventListener("change", function() {
  changeAll(B1, G1, S1, "item1")
}), G1.addEventListener("change", function() {
  changeAll(B1, G1, S1, "item1")
}), S1.addEventListener("change", function() {
  changeAll(B1, G1, S1, "item1")
}), B2.addEventListener("change", function() {
  changeAll(B2, G2, S2, "item2")
}), G2.addEventListener("change", function() {
  changeAll(B2, G2, S2, "item2")
}), S2.addEventListener("change", function() {
  changeAll(B2, G2, S2, "item2")
});
              
            
!
999px

Console