JSFiddle - React, Tailwind, and code Playground

by abernov

HTML

<div class="container">
    <div class="col-1 cell">
        <h1>Title</h1>
    </div>
    <div class="col-2 cell">
        <nav>
            <ul>
                <li><a href="#">Main #1</a></li>
                <li><a href="#">Main #2</a></li>
                <li><a href="#">Main #3</a></li>
                <li><a href="#">Main #4</a></li>
                <li><a href="#">Main #5</a></li>
            </ul>
        </nav>
    </div>
    <div class="col-3 cell">
        <div class="foo">
            <img src="http://placehold.it/50x50" alt="">
        </div>
        <div class="bar">
            Some overly long title that should be ellipsis
        </div>
        <div class="baz">
            v
        </div>
    </div>
</div>

SCSS

.container {
    border: 1px solid #ccc;
    display: table;
    padding: 30px 15px;
    table-layout: fixed;
    width: 100%;
}

.cell {
    display: table-cell;
    vertical-align: middle;
}

.col-1 {
    width: 25%;
    
    h1 {
        margin: 0;
        padding: 0;
    }
}

.col-2 {
    width: 50%;
    
    ul {
        margin: 0;
        padding: 0;
    }
    
    li {
        float: left;
        list-style: none;
        margin-right: 10px;
    }
}

.col-3 {
    width: 25%;
    
    .foo {
        float: left;
        
        img {
            display: block;
            margin: 0;
            padding: 0;
        }
    }
    
    .bar {
        float: left;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        
        /* new css */
        max-width: 100%;
    }
    
    .baz {
        background: #ccc;
        float: left;
        height: 50px;
        line-height: 50px;
        padding: 0 5px;
    }
}