JSFiddle - React, Tailwind, and code Playground
by Abdul Ahmad
HTML
<div class='content'>
<div class='input-box'>
<h3 class='story-title'>
<div class='content'>
Story Title
</div>
</h3>
<div class='row content'>
<h3 class='title'>
Question Title
</h3>
<input class='flat'/>
</div>
<div class='row content'>
<h3 class='title'>
Question Title
</h3>
<input class='flat gray lg'/>
</div>
<div class='row content'>
<h3 class='title'>
Question Title
</h3>
<div class='matrix-box'>
<div class='row'>
<h4 class='title'>
Matrix choices
</h4>
<div class='matrix-options'>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div class='content'>
Option
</div>
</div>
</div>
</div> <!-- matrix row -->
<div class='row'>
<h4 class='title'>
Matrix choices
</h4>
<div class='matrix-options'>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div class='content'>
Option
</div>
</div>
<div class='option'>
<div...
CSS
body {
margin: 0;
font-family: sans-serif;
color: #25292B;
}
.content {
width: 90%;
max-width: 1000px;
margin: 0 auto;
}
.input-box {
width: 100%;
background: white;
margin: 20px 0;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
box-shadow: 0 1px 1px 0 gray;
}
.input-box .row {
padding: 40px 0 30px;
border-bottom: 1px solid #eee;
}
.input-box .row:last-of-type {
border-bottom: 0;
}
.story-title {
font-weight: 100;
font-size: 25px;
border-bottom: 1px solid #ddd;
margin: 0;
padding: 20px 0;
color: #B82E93;
border-top-right-radius: 10px;
}
input.lg {
height: 150px;
}
.input-box input {
margin: 0;
}
.input-box .title {
font-weight: 100;
font-size: 16px;
margin: 0;
margin-bottom: 5px;
color: #30538d;
}
.flat {
border: 1px solid #ccc;
border-top-color: #aaa;
outline: none;
padding: 10px;
border-radius: 2px;
margin: 10px;
display: block;
width: calc(100% - 20px);
transition: all 0.15s ease;
background: #F2F4F5;
}
.flat:hover {
background: white;
transition: all 0.15s ease;
}
.flat:focus {
box-shadow: 0 1px 2px 0 #ddd inset;
border-color: #43A4E6;
background: white;
transition: all 0.15s ease;
}
.matrix-box .row {
padding: 5px 0;
border-bottom: 0;
}
// no need for first of type
// it makes the space between the question title
// and the row title too small
.matrix-box .row:last-of-type {
padding-bottom: 0;
}
.matrix-box .title {
font-size: 14px;
color: #25292B;
margin-bottom: 3px;
}
.matrix-box .matrix-options {
display: flex;
max-width: 500px;
background: #81a2c3;
background: linear-gradient( 45deg, #81a2c3, #1964B0 );
border-radius: 5px;
overflow: hidden;
font-size: 14px;
}
.matrix-box .option {
flex-shrink: 0;
flex-grow: 1;
text-align: center;
padding: 7px 0 8px;
border-right: 1px solid white;
color: white;
}
.matrix-box .option:last-of-type {
border-right: 0;
}
.checkbox.row {
border-bottom: 0;
...