JSFiddle - React, Tailwind, and code Playground

by kirito0709

HTML

<div class="check-color">
<div class="row">
  <div class="col-xs-12">
    <div class="text-color-for-tent">
      Цвет тента:
    </div>
    <div class="color-for-tent">
      <label class="tent-color">
        <input id="t-color-1" name="tent-color" value="1" type="radio" checked />
        <div data-title="Серый"><i>✔</i></div>
      </label>
      <label class="tent-color">
        <input id="t-color-2" name="tent-color" value="2" type="radio" />
        <div data-title="Зеленый"><i>✔</i></div>
      </label>
      <label class="tent-color">
        <input id="t-color-3" name="tent-color" value="3" type="radio" />
        <div data-title="Синий"><i>✔</i></div>
      </label>
      <label class="tent-color">
        <input id="t-color-4" name="tent-color" value="4" type="radio" />
        <div data-title="Бежевый"><i>✔</i></div>
      </label>
      <label class="tent-color">
        <input id="t-color-5" name="tent-color" value="5" type="radio" />
        <div data-title="Белый"><i>✔</i></div>
      </label>
    </div>
  </div>

  <div class="col-xs-12" style="margin-top:20px;">
    <div class="text-color-for-constract">
      Цвет каркаса:
    </div>
    <div class="color-for-constract">
      <label class="constract-color">
        <input id="c-color-1" name="constract-color" value="1" type="radio" checked />
        <div data-title="Серебрянный"><i>✔</i></div>
      </label>
      <label class="constract-color">
        <input id="c-color-2" name="constract-color" value="2" type="radio" />
        <div data-title="Белый"><i>✔</i></div>
      </label>
      <label class="constract-color">
        <input id="c-color-3" name="constract-color" value="3" type="radio" />
        <div data-title="Черный"><i>✔</i></div>
      </label>
    </div>
  </div>
</div>
</div>

CSS

/* цвет тента */
label.tent-color {
  display: inline-block;
  vertical-align: top;
}
label.tent-color input {
  display: none;
}
label.tent-color input#t-color-1+div {
  background: #82a5bb;
}
label.tent-color input+div {
  width: 24px;
  height: 24px;
  text-align: center;
  opacity: 0.8;
  border: 1px solid #000;
  box-sizing: border-box;
}
label.tent-color input:checked+div {
  opacity: 1;
}
label.tent-color input+div i {
	display: none;
	line-height: 24px;
	font-size:18px;
}
label.tent-color input:checked+div i {
	display: block;
	top: -2px;
	position: relative;
}
/* //цвет тента */

/*Подсказки для цветов тента*/
label.tent-color input+div:hover::before {
  content: attr(data-title);
  position: relative;
  top: -40px;
  left: -100%;
  padding: 5px 10px;
  border: 1px solid #333;
  background: rgba(255,255,230,1);
}
label.tent-color input+div:hover::after {
  content: '';
  display: block;
  position: relative;
  height: 0;
  width: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(0,0,0,.7);
  opacity: 1;
  top: -35px;
  z-index:1;
}
label.tent-color input:checked+div:hover::before {
  top: -40px;
}
label.tent-color input:checked+div:hover::after {
  top: -59px;
}
label.tent-color input:checked+div:hover i {
  top: -18px;
  position: relative;
}
/*конец Подсказки для цветов тента*/

/*Подсказки для цветов каркаса*/
label.constract-color input+div:hover::before {
  content: attr(data-title);
  position: relative;
  top: -40px;
  left: -100%;
  padding: 5px 10px;
  border: 1px solid #333;
  background: rgba(255,255,230,1);
}
label.constract-color input+div:hover::after {
  content: '';
  display: block;
  position: relative;
  height: 0;
  width: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(0,0,0,.7);
  opacity: 1;
  top: -35px;
  z-index:1;
}
label.constract-color input:checked+div:hover::before {
  top: -40px;
}
label.constract-color...