JSFiddle - React, Tailwind, and code Playground

by Clear

HTML

<input type="checkbox" id="spoiler" style="display: none;">
    <label for="spoiler" id="spoiler">Spoiler</label><br /><br />

<div class="ciao">
    <p>
        Ciao.
    </p>
</div>

CSS

.ciao {
    background: rgba(0,0,0,0.3);
    height: 10px;
    width: 10px;
    -moz-border-radius: 15px;
    -webkit-border-radius: 15px;
    border-radius: 15px;
    transition-property: background, width, height, -moz-border-radius, -webkit-border-radius, border-radius;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(.83, .36, .16, .08);
    color: #fff;
    padding: 10px;
    -moz-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.5), 1px 1px 1px #fff;
    -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.5), 1px 1px 1px #fff;
    box-shadow: inset 2px 2px 3px rgba(0,0,0,0.5), 1px 1px 1px #fff;
}

.ciao a:link, .ciao a:visited {
    color: #fff;
    text-decoration: underline;
}

.ciao p img {
    max-width: 100%;
    min-width: auto;
    height: auto;
    clear: both;
}

.ciao p {
    display: none;
    transition-property: display;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(.83, .36, .16, .08);
    text-shadow: 0px 1px 0px black;
    transition-delay: 0.3s;
}

input[type=checkbox]:checked ~ .ciao {
    background: rgba(0,0,0,0.8);
    width: 97%;
    overflow: auto;
    height: auto;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
}

input[type=checkbox]:checked ~ .ciao p {
    display: block;
    margin: 0;
}

#spoiler {
    cursor: pointer;
    background-image: linear-gradient(bottom, rgb(44,160,202) 0%, rgb(62,184,229) 100%);
background-image: -o-linear-gradient(bottom, rgb(44,160,202) 0%, rgb(62,184,229) 100%);
background-image: -moz-linear-gradient(bottom, rgb(44,160,202) 0%, rgb(62,184,229) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(44,160,202) 0%, rgb(62,184,229) 100%);
background-image: -ms-linear-gradient(bottom, rgb(44,160,202) 0%, rgb(62,184,229) 100%);
background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(44,160,202)), color-stop(1, rgb(62,184,229)) );
    padding:5px 10px 5px 10px;
     color:#fff;
   ...