<form>
<label for="eposta">E-posta</label>
<input type="email" required name="eposta" autocomplete="off" />
<br /><br />
<label for="password">Password</label>
<input type="password" name="username" />
</form>
@import url("https://fonts.googleapis.com/css2?family=Viaoda+Libre&display=swap");
:root {
--primary-color: #1f2029;
--secondary-color: #2a2b38;
--text-color: #c4c3ca;
--form-bg-color: #2a2b38;
--focus-bg-color: hsl(200deg, 55%, 92%);
--white: #fff;
}
body {
font-family: "Lato", sans-serif;
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
background-color: var(--primary-color);
box-sizing: border-box;
}
form {
background-color: var(--form-bg-color);
border-radius: 6px;
padding: 50px 50px 50px 25px;
color: var(--text-color);
width: 240px;
}
form:focus-within {
position: relative;
}
form:focus-within:after {
content: '';
width: 300px;
height: 95%;
position: absolute;
top: 10px;
left: 10px;
box-shadow: inset 0 0 60px whitesmoke, inset 20px 0 80px #f0f,
inset -20px 0 80px #0ff, inset 20px 0 300px #f0f, inset -20px 0 300px #0ff,
0 0 50px #fff, -10px 0 80px #f0f, 10px 0 80px #0ff;
border-radius: 3px;
z-index: -1;
}
label {
font-size: 16px;
}
input {
color: var(--white);
background-color: var(--primary-color);
border: 0;
margin-top: 10px;
padding: 12px;
border-radius: 4px;
font-size: 16px;
outline: none;
width: 100%;
}
input:focus {
box-shadow: 0 1px 0 0 rgb(0 255 255 / 25%), 0 -1px 0 0 rgb(255 0 255 / 25%), 1px 0 0 0 rgb(0 255 255 / 25%), -1px 0 0 0 rgb(255 0 255 / 25%), 1px -1px 0 0 rgb(255 0 255 / 50%), -1px 1px 0 0 rgb(255 0 255 / 50%), 1px 1px 0 0 rgb(255 0 255 / 75%), -1px -1px 0 0 rgb(255 0 255 / 75%);
}
label:has(+ input:invalid)::before {
content: '✖ ';
color: #ff0024;
}
form:has(input:invalid)::after {
box-shadow: inset 0 0 60px whitesmoke, inset 20px 0 80px #ff0024, inset -20px 0 80px #ff8f00, inset 20px 0 300px #ff0058, inset -20px 0 300px #ffc200, 0 0 50px #fff, -10px 0 80px #ff004a, 10px 0 80px #ff5b00;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.