JSFiddle - React, Tailwind, and code Playground

by naykris

HTML

<div class="tabs">
    <input type="radio" name="tabs" id="tab-1" checked>
    <label for="tab-1" class="tab">Featured</label>
    <input type="radio" name="tabs" id="tab-2">
    <label for="tab-2" class="tab">Recent</label>
    <input type="radio" name="tabs" id="tab-3">
    <label for="tab-3" class="tab">Comments</label>
    <div class="content" id="cont-1">
        <a class="post" href="#">
            <i class="post_thumbnail"></i>
            <span class="post_link">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            <span class="post_footer">
                <span>Posted on Oct 16th</span>
                <span>50 Comments</span>
            </span>
        </a>
        <a class="post" href="#">
            <i class="post_thumbnail"></i>
            <span class="post_link">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            <span class="post_footer">
                <span>Posted on Oct 16th</span>
            </span>
        </a>
        <a class="post" href="#">
            <i class="post_thumbnail"></i>
            <span class="post_link">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            <span class="post_footer">
                <span>Posted on Oct 16th</span>
                <span>50 Comments</span>
            </span>
        </a>
        <a class="post" href="#">
            <i class="post_thumbnail"></i>
            <span...

CSS

*{
    box-sizing: border-box;
    font-family: arial, helvetica, sans-serif;
}

input[type="radio"],.content{
    display: none;
}

.tabs{
    width: 300px;
    font-size: 11px;
    margin: 24px auto;
    padding: 18px 18px 0;
    border: 1px solid #bbb;
    border-radius: 4px;
    background-color: #fff;
    background-image: linear-gradient(to bottom, #bbb 0, #ccc 48px, #fff 48px, #efefef);
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.10),
                inset 0 2px rgba(255, 255, 255, 0.75);
}

.tab{
    display: inline-block;
    font-weight: bold;
    color: #959595;
    text-shadow: 0 1px 0 #fff;
    line-height: 28px;
    margin: 0 2px 0;
    padding: 0 16px;
    border-radius: 4px 4px 0 0;
    background-color: #e3e3e3;
    border: 1px solid #fff;
    border-right-color: transparent;
    border-bottom-color: transparent;
}

.content{
    margin: 2px -18px;
}

.post{
    display: block;
    padding: 8px 18px;
    margin-bottom: 3px;
    position:relative;
    text-decoration: none;
}

.post:not(:last-child)::before{
    content:'';
    position:relative;
    border-bottom: 1px solid #e2e2e2;
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: -2px;
}

.post::after{
    content:'';
    display: block;
    clear: both;
}

.post:hover{
    background-color: #e2e2e2;
}

.post:hover .post_link, .post_link:hover{
    color: #115a97;
}

.post_thumbnail{
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 4px;
    background-color: #ddd;
    float: left;
}

.post_link{
    display: block;
    text-decoration: none;
    color: #666;
    font-size: 10px;
    line-height: 1.2;
    font-weight: bold;
    height: 2.4em;
    overflow: hidden;
}

.post_footer{
    display: block;
    margin-top: 8px;
    line-height: 1;
    font-size: 9px;
    color: #999;
}

.post_footer span:not(:first-child)::before{
    content:"|";
    margin: 0 8px;
}

input[type="radio"]:checked+.tab{
    background-color: #fff;
    color:...