<div id="container">
  <div class="flex__container">
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
  </div>
</div>

<div class="forms">
  <div class="controls">
    <label for="direction">direction:</label>
    <select id="direction">
      <option value="ltr">ltr</option>
      <option value="rtl">rtl</option>
    </select>
  </div>
  <div class="controls">
    <label for="writingmode">writing-mode:</label>
    <select id="writingmode">
      <option value="horizontal-tb">horizontal-tb</option>
      <option value="vertical-lr">vertical-lr</option>
      <option value="vertical-rl">vertical-rl</option>
      <option value="sideways-rl">sideways-rl</option>
      <option value="sideways-lr">sideways-lr</option>
    </select>
  </div>

  <div class="controls">
    <label>flex-flow:</label>
    <select id="flexDirection">
      <option value="row">row</option>
      <option value="row-reverse">row-reverse</option>
      <option value="column">column</option>
      <option value="column-reverse">column-reverse</option>
    </select>
    <select id="flexWrap">
      <option value="nowrap">nowrap</option>
      <option value="wrap">wrap</option>
      <option value="wrap-reverse">wrap-reverse</option>
    </select>
  </div>
  <div class="controls">
    <label style="color: #f36;">place-content:</label>
    <select id="alignContent">
      <option value="flex-start">flex-start</option>
      <option value="flex-end">flex-end</option>
      <option value="center">center</option>
      <option value="space-between">space-between</option>
      <option value="space-around">space-around</option>
      <option value="space-evenly">space-evenly</option>
      <option value="stretch">stretch</option>
      <option value="start">start</option>
      <option value="end">end</option>
      <option value="baseline">baseline</option>
      <option value="first baseline">first baseline</option>
      <option value="last baseline">last baseline</option>
    </select>
    <select id="justifyContent">
      <option value="flex-start">flex-start</option>
      <option value="flex-end">flex-end</option>
      <option value="center">center</option>
      <option value="space-between">space-between</option>
      <option value="space-around">space-around</option>
      <option value="space-evenly">space-evenly</option>
      <option value="start">start</option>
      <option value="end">end</option>
      <option value="left">left</option>
      <option value="right">right</option>
    </select>
  </div>
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");

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

body {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  background-color: #291642;
  font-family: "Gochi Hand", sans-serif;
  font-size: 100%;
  letter-spacing: 0.1rem;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr minmax(200px, max-content);
  gap: 20px;
}


.forms {
  height: 100vh;
  overflow-y: auto;
  border-left: 4px solid rgba(255,255,0,.1);
  display: flex;
  flex-direction: column;
  padding: 10px;
  position: relative;
  z-index: 2;
  background-color: rgba(0,0,0,.2);
}
.controls {
  background-color: rgba(0,0,0,.1);
  padding: 5px;
  border-radius: .5em;
  border: 1px solid rgba(0,0,0,.2);
  margin: 5px;
}

.controls select {
  font-size: .9em;
  max-width: 100px;
  min-width: 100px;
}

:root {
  --writingMode: horizontal-tb;
  --direction: ltr;
  --flexDirection: row;
  --flexWrap: nowrap;
  --alignContent: flex-start;
  --justifyContent: flex-start;
}

#container {
  writing-mode: var(--writingMode);
  direction: var(--direction);
  
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex__container {
  display: flex;
  flex-flow:var(--flexDirection) var(--flexWrap);
  place-content: var(--alignContent) var(--justifyContent);
  
  inline-size: 80vh;
  block-size: 40vh;
  border: 1px dashed #E91E63;
  border-color: #FFEB3B #FF5722 #fff #00BCD4; 
  position: relative;
  counter-reset: listCounter;
}

.flex__item {
  display: flex;
  justify-content: center;
  align-items: center;
/*   inline-size: 10vh;
  block-size: 10vh; */
  counter-increment: listCounter;
}

.flex__item::before {
  content:  "[" counter(listCounter) "]";
  font-size: 2rem;
  background: rgba(0,0,0,.65);
  padding: 4px;
  border-radius: 4px;
}

.flex__item:nth-child(1) {
  background-color: #f36;
}

.flex__item:nth-child(2) {
  background-color: #CDDC39;
}

.flex__item:nth-child(2)::before {
  font-size: 4rem;
}

.flex__item:nth-child(3) {
  background-color: #2196F3;
}

.flex__item:nth-child(4) {
  background-color: #FF5722;
}

.flex__item:nth-child(4)::before {
  font-size: 1rem;
}

.flex__item:nth-child(5) {
  background-color: #F22;
}

.flex__item:nth-child(6) {
  background-color: #722;
}

.flex__item:nth-child(7) {
  background-color: #FF5;
}

.flex__item:nth-child(8) {
  background-color: #9f9f9f;
}

.flex__item:nth-child(10) {
  background-color: #F2f;
}

.flex__item:nth-child(11) {
  background-color: #9ffc22;
}

.flex__item:nth-child(12) {
  background-color: #d22;
}

.flex__item:nth-child(13) {
  background-color: #2efeaf;
}

.flex__item:nth-child(14) {
  background-color: #aff;
}

.flex__item:nth-child(15) {
  background-color: #FF0;
}

.flex__item:nth-child(16) {
  background-color: #F7f2f2;
}
View Compiled
const writingMode = document.getElementById("writingmode");
const direction = document.getElementById("direction");
const flexDirection = document.getElementById("flexDirection");
const flexWrap = document.getElementById("flexWrap");
const alignContent = document.getElementById("alignContent");
const justifyContent = document.getElementById("justifyContent");

const documentElement = document.documentElement;

writingMode.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--writingMode", evt.target.value);
});

direction.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--direction", evt.target.value);
});

flexDirection.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--flexDirection", evt.target.value);
});

flexWrap.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--flexWrap", evt.target.value);
});


alignContent.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--alignContent", evt.target.value);
});

justifyContent.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--justifyContent", evt.target.value);
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.