<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<h1>Pure CSS - Accordion With Input Edit</h1>
<ul class="treeview checklist">
<li>
<input type="checkbox" name="tall" id="tall">
<label for="tall">
<div class="ball" data-id="1"></div>
<input type="text" value="Input value">
<div class="action-list">
<i class="fa fa-trash"></i>
<i class="fa fa-plus"></i>
</div>
</label>
<ul>
<li>
<input type="checkbox" name="tall-1" id="tall-1">
<label for="tall-1">
<div class="ball" data-id="2"></div>
<input type="text" value="Text input 1">
<div class="action-list">
<i class="fa fa-trash"></i>
<i class="fa fa-plus"></i>
</div>
</label>
<ul>
<li>
<label>
<div class="ball" data-id="3"></div>
<input type="text" value="Text input 2">
</label>
</li>
</ul>
</li>
</ul>
</li>
</ul>
*,
*:before,
*:after {
box-sizing: border-box;
outline: none;
text-rendering: optimizeLegibility;
font-smoothing: antialiased;
osx-font-smoothing: grayscale;
}
/*Title Default*/
body {
background: #343436;
color: #777;
font-family: arial;
}
h1 {
margin: 1em 0;
text-align: center;
border-bottom: 1px dashed;
padding-bottom: 1em;
font-weight: lighter;
}
/*Treeview ***********************************************/
.treeview input[type=checkbox]{
display:none
}
.treeview,
.treeview ul{
padding: 0;
margin: 0;
overflow: hidden;
}
.treeview li{
padding-left: 27px;
position: relative;
font-size: 1rem;
margin-top: 4px;
display: flex;
flex-direction: column
}
.treeview > li{
padding-left: 0;
}
.treeview ul{
max-height: 0;
transition: .8s ease;
transition: .8s ease;
transition: .8s ease;
transition: .8s ease;
}
.treeview li input:nth-of-type(1):checked ~ ul{
max-height: 1000px;
}
.treeview li label{
padding: 16px;
padding-left: 78px;
background-color: #f3f3f4;
cursor: pointer;
border-radius: 100px;
height: 65px;
font-size: 13px;
display: flex;
align-items: center;
}
.treeview li label i{
font-size: 14px
}
.treeview li label > span{
margin: 0 20px
}
.treeview li label input[type=text]{
flex: 1;
color: #676A6C;
background: white;
border: none;
border-radius: 3px;
transition: .2s ease;
padding: 9px;
margin-left: 10px;
background: none
}
.treeview li label input[type=text]:focus,
.treeview li label input[type=text]:hover{
background: white
}
.treeview li label:not(.child):before{
transition: .3s ease;
position: absolute;
margin-left: -16px;
}
.treeview li label:not(.child):before{
font: normal normal normal 14px/1 FontAwesome;
content: "\f054";
}
.treeview li input[type=checkbox]:checked + label:before{
transform: rotate(90deg);
}
.treeview .ball{
left: 16px;
margin-left: -60px;
padding-right: 30px;
}
.treeview .ball:before{
color: #fff;
position: relative;
display: flex;
border-radius: 50%;
background-color: #23c6c8;
align-items: center;
height: 23px;
width: 23px;
font-size: 13px;
justify-content: center;
content: attr(data-id);
}
.treeview .action-list{
margin-left: auto
}
.treeview .action-list i{
margin-left: 15px
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.