<h1>W3cplus.com !!!</h1>
<div id="box">
<label for="color">color:</label>
<input type="color" value="#fff" id="color" />
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
background-color: #291642;
font-family: "Gochi Hand", sans-serif;
color: #fff;
font-size: 130%;
letter-spacing: 0.1rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100vw;
min-height: 100vh;
}
:root {
--color: #fff;
}
h1 {
display: inline-flex;
position: relative;
padding-bottom: 8vh;
font-size: 20vh;
cursor: pointer;
transition: all 0.2s ease;
color: var(--color);
&:hover {
color: #f36;
}
&::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 4vh;
height: 6vh;
background-color: currentColor;
mask-image: url("https://tylergaw-assets.s3.amazonaws.com/inline-masks/repeater.svg#squiggle");
}
}
View Compiled
const color = document.getElementById("color");
function handleUpdate(e) {
document.documentElement.style.setProperty(`--color`, this.value);
}
color.addEventListener("change", handleUpdate);
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.