<h1>NEUMORPHISM</h1>
<div class="entire-form">
<div class="left-side">
</div>
<form class="right-side">
<h2>This is a form</h2>
<label for="first-input">First Name</label>
<input type="text" id="first-input" name="firstname" placeholder="This is a styling demo..." required>
<label for="last-input">Last Name</label>
<input type="text" id="last-input" name="lastname" placeholder="The styling demo continues...">
<label for="coolness">How cool are you?</label>
<select id="coolness" name="cool">
<option value="value-one">Kind of cool</option>
<option value="value-two">Very cool</option>
<option value="value-three">Super cool</option>
</select>
<div class="wrapper">
<label class="radiobutton-container">Val1
<input type="radio" name="answer" checked="checked">
<span class="custom-radio"></span>
</label>
<label class="radiobutton-container">Val2
<input type="radio" name="answer">
<span class="custom-radio"></span>
</label>
<label class="radiobutton-container">Val3
<input type="radio" name="answer">
<span class="custom-radio"></span>
</label>
</div>
<div class="wrapper">
<label class="checkbox-container">
<input type="checkbox" checked="checked">
Subscribe to e-mail list?
<span class="custom-checkbox"></span>
</label>
</div>
<input type="submit" value="Submit">
</form>
</div>
@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@400;900&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
height: 100vh;
width: 100vw;
font-family: "Raleway", sans-serif;
color: #6c7275;
background: #dbe6ef;
}
h1 {
display: block;
font-family: "Raleway", sans-serif;
font-size: 60px;
text-align: center;
width: 500px;
color: #dbe6ef;
text-shadow: 2px 2px 2px #b0b9bf, -2px -2px 4px #fcffff;
padding: 20px;
border-radius: 10px;
box-shadow: 5px 5px 10px #b0b9bf, -5px -5px 10px #fcffff;
}
h2 {
padding-bottom: 15px;
text-align: center;
font-weight: 400;
}
.entire-form {
display: flex;
align-items: center;
}
.left-side {
width: 20px;
height: 350px;
display: flex;
justify-content: flex-end;
padding: 50px;
background: #dbe6ef;
border-radius: 100% 0% 0% 100% / 50% 0% 0% 50%;
border-radius: 20px 0px 0px 20px;
box-shadow: 5px 5px 10px #b0b9bf, -5px -5px 10px #fcffff;
}
.right-side {
position: abasolute;
z-index: 10;
width: 400px;
height: 500px;
display: flex;
flex-direction: column;
padding: 50px;
border-radius: 10px 20px 20px 10px;
background: #dbe6ef;
box-shadow: 5px 5px 10px #b0b9bf, -5px -5px 10px #fcffff;
}
input[type="text"] {
height: 30px;
border: none;
padding: 5px 5px 5px 10px;
margin: 4px 0 10px;
border-radius: 6px;
background: #e9eff5;
box-shadow: inset 2px 2px 4px #bac4cb, inset -2px -2px 4px #fff;
}
input[type="submit"] {
width: fit-content;
background: none;
border: none;
color: #6c7275;
font-size: 20px;
margin: 20px auto;
padding: 10px 20px;
border-radius: 20px;
box-shadow: 3px 3px 6px #b0b9bf, -3px -3px 6px #fcffff;
}
input[type="submit"]:hover {
box-shadow: 1px 1px 2px #b0b9bf, -1px -1px 2px #fcffff;
}
input[type="submit"]:active {
box-shadow: inset 3px 3px 6px #b0b9bf, inset -3px -3px 6px #fcffff;
}
select {
width: 100%;
height: 30px;
background: none;
color: #6c7275;
border: none;
margin: 20px auto;
padding: 10px 20px;
border-radius: 6px;
box-shadow: 4px 4px 8px #b0b9bf, -4px -4px 8px #fcffff;
padding: 5px 5px 5px 10px;
margin: 4px 0 10px;
}
select:hover {
box-shadow: inset 4px 4px 8px #b0b9bf, inset -4px -4px 8px #fcffff;
}
.wrapper {
display: flex;
justify-content: space-around;
}
/* Container for both radiobutton and label*/
.radiobutton-container {
display: block;
position: relative;
padding-left: 25px;
margin: 10px 5px;
cursor: pointer;
font-size: 16px;
user-select: none;
}
/* Hide the default radiobutton */
.radiobutton-container input {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Hide the default radio-button */
.custom-radio {
position: absolute;
top: 0;
left: 0;
height: 19px;
width: 19px;
border-radius: 50%;
background: #dbe6ef;
box-shadow: 2px 2px 4px #bac4cb, -2px -2px 4px #fcffff;
}
/* On hover add darken background for custom radio-button*/
.radiobutton-container:hover input ~ .custom-radio {
border-radius: 50px;
background: linear-gradient(145deg, #c5cfd7, #eaf6ff);
box-shadow: 2px 2px 4px #bac4cb, -2px -2px 4px #fcffff;
}
/* When the radio-button is checked, darker background */
.radiobutton-container input:checked ~ .custom-radio {
border-radius: 50px;
background: #dbe6ef;
box-shadow: inset 2px 2px 4px #bac4cb, inset -2px -2px 4px #fcffff;
}
/* Create the circle for checked radio-button (hidden when not checked) */
.custom-radio:after {
content: "";
position: absolute;
display: none;
}
/* Show the dot when checked */
.radiobutton-container input:checked ~ .custom-radio:after {
display: block;
}
/* Style the indicator (dot/circle) */
.radiobutton-container .custom-radio:after {
top: 6px;
left: 6px;
width: 7px;
height: 7px;
border-radius: 50%;
background: grey;
}
/* Add outline to focused radio-button !important */
.radiobutton-container input:focus + .custom-radio {
outline: #333 auto 4px;
}
/* Container for both checkbox and label*/
.checkbox-container {
display: block;
position: relative;
padding-left: 25px;
margin: 10px 5px;
cursor: pointer;
font-size: 16px;
user-select: none;
}
/* Hide the default checkbox */
.checkbox-container input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
/* Hide the default checkbox */
.custom-checkbox {
position: absolute;
top: 0;
left: 0;
height: 19px;
width: 19px;
border-radius: 4px;
background: #dbe6ef;
box-shadow: 2px 2px 4px #bac4cb, -2px -2px 4px #fcffff;
}
/* On hover add darken background for custom checkbox*/
.checkbox-container:hover input ~ .custom-checkbox {
background: linear-gradient(145deg, #c5cfd7, #eaf6ff);
box-shadow: 2px 2px 4px #bac4cb, -2px -2px 4px #fcffff;
}
/* When the checkbox is checked, darker background */
.checkbox-container input:checked ~ .custom-checkbox {
background: #dbe6ef;
box-shadow: inset 2px 2px 4px #bac4cb, inset -2px -2px 4px #fcffff;
}
/* Create the checkmark/indicator (hidden when not checked) */
.custom-checkbox:after {
content: "";
position: absolute;
display: none;
}
/* Show the checkmark when checked */
.checkbox-container input:checked ~ .custom-checkbox:after {
display: block;
}
/* Style custom checkmark ✔ */
.checkbox-container .custom-checkbox:after {
left: 7px;
top: 5px;
width: 3px;
height: 6px;
border: solid grey;
border-width: 0 3px 3px 0;
transform: rotate(45deg);
}
/* Add outline to focused checkbox !important */
.checkbox-container input:focus + .custom-checkbox {
outline: #333 auto 5px;
}
/* Inspired by https://codepen.io/ricardoolivaalonso/pen/YzyaRPN , all though a much simpler version */
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.