todo markup example

In this example below you will see how to do a todo markup example with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by roikles, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright roikles ©
  • HTML
  • CSS
  • JavaScript
    <ul class="todo-list">
    <li class="todo-item">
        <a class="todo-item__link" href="#">Milk</a>
        <a class="todo-item__confirmation" href="#"></a>
    </li>
    
    <li class="todo-item todo-item--completed">
        <a class="todo-item__link" href="#">Egg</a>
        <a class="todo-item__confirmation" href="#">✔</a>
    </li>
    
    <li class="todo-item todo-item--completed">
        <a class="todo-item__link" href="#">Bacon</a>
        <a class="todo-item__confirmation" href="#">✔</a>
    </li>
    
    <li class="todo-item">
        <a class="todo-item__link" href="#">Cheese</a>
        <a class="todo-item__confirmation" href="#"></a>
    </li>
    
    <li class="todo-item">
        <a class="todo-item__link" href="#">Bread</a>
        <a class="todo-item__confirmation" href="#"></a>
    </li>
    
    <li class="todo-item">
        <a class="todo-item__link" href="#">Avocado</a>
        <a class="todo-item__confirmation" href="#"></a>
    </li>
</ul>

/*Downloaded from https://www.codeseek.co/roikles/todo-markup-example-JZKVgG */
    .todo-list {
    margin: 0 auto;
    max-width: 400px;
    list-style: none;
    padding: 0;
}

.todo-item {
    display: flex;
    width: 100%;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.todo-item__confirmation {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    text-decoration: none;
    border: 2px solid blue;
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.todo-item--completed {
    .todo-item__link {
        color: #ccc;
        text-decoration: line-through;
        border-color: #ccc;
    }

    .todo-item__confirmation {
        color: #ccc;
        border-color: #ccc;
        text-decoration: none;
    }
}

.todo-item__link {
    display: inline-block;
    flex-grow: 1;
}

















@import url('https://fonts.googleapis.com/css?family=Work+Sans');

body {
    font-family: 'Work Sans', sans-serif;
}


/*Downloaded from https://www.codeseek.co/roikles/todo-markup-example-JZKVgG */
    

Comments