JSFiddle - React, Tailwind, and code Playground

by mrjordy

HTML

<div class="band onBand bandOne flex ">
  <div class="bandItem hasDropDown">thing one</div>
  <div class="bandItem">thing two</div>
  <div class="bandItem">thing three</div>
  <div class="bandItem">thing four</div>
</div>
<div class="band onBand bandOne flex heightZero">
  <div class="bandItem">thing one</div>
  <div class="bandItem">thing two</div>
  <div class="bandItem">thing three</div>
  <div class="bandItem">thing four</div>
</div>
<div class="thirtyPixSpace"></div>

<div class="band offBand bandTwo flex">
  <div class="bandItem">thing one</div>
  <div class="bandItem hasDropDown">thing two</div>
  <div class="bandItem">thing three</div>
</div>

CSS

/*------tools------*/
.heightZero {height:0 !important;min-height:0 !important;overflow:hidden;}
.flex {display:-webkit-flex;display:flex;}
.thirtyPixSpace {height: 30px;}
/*------style------*/

.band {

}
.onBand {
  background: lightblue;
}

.bandItem {
  padding: 20px;
  -webkit-flex-grow: 1;
  flex-grow: 1;
  border: 1px solid red;
  margin: 4px;
  text-align: center;
  position: relative;
}
.hasDropDown {
  cursor: pointer;
}
.hasDropDown:after {
    content: '';
    display: block;
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 0px solid #f00;
    margin-left: calc(50% - 40px);
    margin-top: 20px;
    transition: .2s;
}
.hasDropDown:hover:after {
    content: '';
    display: block;
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 16px solid #f00;
    margin-left: calc(50% - 40px);
    margin-top: 20px;
}