JSFiddle - React, Tailwind, and code Playground

by Matthew Day

HTML

<div class="component temp">90º</div>
<div class="component humidity">30%</div>

CSS

.component {
  border-radius: 4px;
  color: white;
  font-size: 2em;
  margin: 40px 0;
  padding: 4px 0;
  position: relative;
  text-align: center;
  width: 60px;
}

.component:before {
    color: black;
    font-size: 0.5em;
    left: 0;
    position: absolute;
    top: -20px;
}

.temp {
  background: crimson;
  border: 1px solid crimson;
}

.temp:before {
    content: 'Temperature';
  }

.humidity {
  background: yellow;
  border: 1px solid yellow;
}

.humidity:before {
  content: 'Humidity';
}

JavaScript

.navitems {
  &.active {
  
  }
}

.navitems.active {
  .....
}