JSFiddle - React, Tailwind, and code Playground

by RXBeat

HTML

<div class="togglebox">

        <div>
            <input id="checkbox1" type="checkbox" name="toggle"/>
            <label style="background-color:green" for="checkbox1">111</label>
            <div class="content">
<p>Zeile 1</p>
<p>Zeile 2</p>
<p>Zeile 3</p>
            </div>
        </div>


        <div>
            <input id="checkbox2" type="checkbox" name="toggle"/>
            <label style="background-color:red" for="checkbox2">222</label>
            <div class="content">
<p>Zeile 1</p>
<p>Zeile 2</p>
<p>Zeile 3</p>
            </div>
        </div>


        <div>
            <input id="checkbox3" type="checkbox" name="toggle"/>
            <label style="background-color:chocolate" for="checkbox3">333</label>
            <div class="content">
<p>Zeile 1</p>
<p>Zeile 2</p>
<p>Zeile 3</p>
            </div>
        </div>

</div>

CSS

.togglebox {
            width: 92%;
            height: 150%;
            margin: 0 auto;
            background: #00000000;
            text-align: left;
            line-height: 0.7;
        }

        input[type="checkbox"] {
            position: absolute;
            opacity: 0;
        }

        label {
            position: relative;
            display: block;
            height: 24px;
            line-height: 24px;
            padding: 0 20px;
            font-size: 14px;
            font-weight: bold;
            color: white;
            text-shadow: black 0.1em 0.1em 0.2em;
            background: #2e4155;
            cursor: pointer;

            border-style: solid;
            border-width: 1px;
            border-color: #000000;
        }

        label:hover {
            background: #1f2d3a;
        }

        label:after {
            content: '\f078';
            top: 0px;
            right: 20px;
            font-family: fontawesome;
            position: absolute;
        }

        .content {
            height: 0;
            overflow: hidden;
        }

        input[type="checkbox"]:checked~label {
            color: white;
            text-shadow: black 0.1em 0.1em 0.2em;
            font-size: 20px;
        }

        input[type="check"]:checked~label:after {
            transform: rotate(90deg);
            -moz-transform: rotate(90deg);
            -o-transform: rotate(90deg);
            -ms-transform: rotate(90deg);
            -webkit-transform: rotate(90deg);
        }

        input[type="checkbox"]:checked~.content {
            height: 100%;
        }