Fancy checkboxes

by trolleymusic

HTML

<ul class="results">
    <li class="item">
        <input type="checkbox">
        <label><span class="text"><span class="sales-code">Sales Code</span> Product Name</span></label>
    </li>
    <li class="item">
        <input type="checkbox">
        <label><span class="text"><span class="sales-code">Sales Code</span> Product Name</span></label>
    </li>
    <li class="item">
        <input type="checkbox">
        <label><span class="text"><span class="sales-code">Sales Code</span> Product Name</span></label>
    </li>
    <li class="item">
        <input type="checkbox">
        <label><span class="text"><span class="sales-code">Sales Code</span> Product Name</span></label>
    </li>
    
</ul>

CSS

.item {
    border: 1px solid #000;
    height: 115px;
    position: relative;
    width: 300px;
}

.item label {
    position: absolute;
    width: 100%;
    height: 100%;    
}

.item input {
    position: absolute;
    width: 100%;
    height: 100%;  
    opacity: 0;
    z-index: 100;
    cursor: pointer;
}

.item input ~ label:before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50px;
    background: #dfdedd;
}

.item input ~ label:after {
    color: #fff;
    content: '+';
    display: block;
    position: absolute;
    height: 50px;
    line-height: 50px;
    font-size: 50px;
    text-align: center;
    top: 50%;
    margin-top: -25px;
    left: 0;
    width: 50px;
}

.item input:checked ~ label:before {
    background: green;
}

.item input:checked ~ label:after {
     content: '–';   
}

.text {
    display: block;
    font-size: 16px;
    position: relative;
    padding: 20px 0 0 60px;
}

.sales-code {
    display: block;
    font-size: 12px;
}