<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>
</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 for="flexDirection">flex-direction:</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>
  </div>
  <div class="controls">
    <label for="flexWrap">flex-wrap:</label>
    <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 for="alignContent">align-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>
  </div>
  <div class="controls">
    <label for="justifyContent">justify-content:</label>
    <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 class="controls">
    <label for="alignItems">align-items:</label>
    <select id="alignItems">
      <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>
  </div>

  <div class="controls">
    <label for="alignSelf">algin-self:</label>
    <select id="alignSelf">
      <option value="auto">auto</option>
      <option value="flex-start">flex-start</option>
      <option value="flex-end">flex-end</option>
      <option value="center">center</option>
      <option value="baseline">baseline</option>
      <option value="stretch">stretch</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;
  --alignItems: flex-start;
  --alignSelf: auto;
}

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

.flex__container {
  display: flex;
  flex-direction:var(--flexDirection);
  flex-wrap: var(--flexWrap);
  align-content: var(--alignContent);
  justify-content: var(--justifyContent);
  align-items: var(--alignItems);
  
  inline-size: 60vh;
  block-size: 30vh;
  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: 15vh;
  block-size: 15vh; */
  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(3) {
  background-color: #2196F3;
}

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

.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(2)::before {
  font-size: 3rem;
}

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

.flex__item:nth-child(odd) {
  align-self: var(--alignSelf);
}
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 alignItems = document.getElementById("alignItems");
const alignSelf = document.getElementById("alignSelf");

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);
});

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

alignSelf.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--alignSelf", 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.