JSFiddle - React, Tailwind, and code Playground
by Ravindra Athreya
HTML
<div class="regular45sp">Pure CSS Notification Bars</div>
<!-- Label to Show Notification bar -->
<label for="toggleTop" id="showTop" title="Toggle On/Off">+</label>
<!-- The checkbox -->
<input type="checkbox" id="toggleTop" name="toggleTop" value="toggleTop" checked="checked">
<!-- The Notification bar container -->
<div id="topbar">Hi there! Good to notify you.
<!-- Label to Hide Notification bar -->
<label for="toggleTop" id="hideTop" title="Close">x</label>
</div>
CSS
* {
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
}
body {
background-color: rgb(89, 211, 156);
margin:0;
}
.regular45sp {
font-family: 'Roboto', sans-serif;
font-weight: 600;
font-size: 45px;
color: #212121;
line-height: 36px;
text-align: center;
letter-spacing: -.5px;
text-indent: -3px;
padding: 50px;
}
ul {
list-style: none;
width: 100%;
font-size: 0;
margin: 0px;
padding: 0px;
}
li {
display: inline-block;
width: 20%;
height: 7px;
}
li:nth-child(1) {
background: #2ecc71;
}
li:nth-child(2) {
background: #3498db;
}
li:nth-child(3) {
background: #f1c40f;
}
li:nth-child(4) {
background: #e74c3c;
}
li:nth-child(5) {
background: #9b59b6;
}
/* Styling the bar itself */
#topbar {
position: fixed;
bottom: -60px;
display: block;
z-index: 99999;
box-sizing: border-box;
width: 100%;
padding: 15px;
background-color: #323232;
color: rgb(250, 250, 250);
font-size: 14px;
font-weight: 400;
letter-spacing: 0.010em;
line-height: 16px;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .26);
border-radius: 2px;
transition: bottom 0.5s cubic-bezier(0.42, 0.0, 0.58, 1.0);
font-family: sans-serif;
left: 10px;
max-width: 320px;
text-rendering: optimizeLegibility;
}
/* Hiding the checkbox */
#toggleTop {
display: none;
}
/* Styling the lables, to show and hide the bar */
#showTop {
position: fixed;
z-index: 9999;
top: 7px;
right: 30px;
display: block;
padding: 10px;
background-color: #000000;
color: #fff;
cursor: pointer;
font-weight: bold;
transition: background-color .4s cubic-bezier(.25, .8, .25, 1);
text-rendering: optimizeLegibility;
}
#showTop:hover {
background-color: rgba(158, 158, 158, 0.2);
color: rgba(0, 0, 0, 0.8);
}
#hideTop {
float: right;
display: inline-block;
cursor: pointer;
padding: 2px 6px;
font-weight: bold;
transition: all .4s cubic-bezier(.25, .8, .25, 1);
}
#hideTop:hover {
background-color:...