<div class="flex__container">
  <div class="flex__item" style="--flexGrow: 0">flex-grow:0</div>
  <div class="flex__item" style="--flexGrow: 1">flex-grow:1</div>
  <div class="flex__item" style="--flexGrow: 2">flex-grow:2</div>
  <div class="flex__item" style="--flexGrow: 3">flex-grow:3</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: flex;
  justify-content: center;
  align-items: center;
}

:root {
  --flexGrow: 0;
}

.flex__container {
  inline-size: 80vw;
  display: flex;

  border: 1px dashed #f36;
  align-items: stretch;
}

.flex__item {
  padding: 2vh;
  min-block-size: 12vh;
  inline-size: 10vw;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: var(--flexGrow);
}

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

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

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

.flex__item:nth-child(4) {
  background-color: #ff5722;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.