<table>
<thead>
<tr>
<th>Elements</th>
<th>Default</th>
<th>Custom</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><input type="checkbox"></code></td>
<td>
<input type="checkbox" name="checkbox1" checked>
<input type="checkbox" name="checkbox1">
<input type="checkbox" name="checkbox1">
</td>
<td>
<input type="checkbox" name="checkbox2" class="custom" checked>
<input type="checkbox" name="checkbox2" class="custom">
<input type="checkbox" name="checkbox2" class="custom">
</td>
<tr>
<td><code><input type="radio"></code></td>
<td>
<input type="radio" name="radio1">
<input type="radio" name="radio1" checked>
<input type="radio" name="radio1">
</td>
<td>
<input type="radio" name="radio2" class="custom">
<input type="radio" name="radio2" class="custom" checked>
<input type="radio" name="radio2" class="custom">
</td>
</tr>
<tr>
<td><code><input type="range"></code></td>
<td><input type="range"></td>
<td><input type="range" class="custom"></td>
</tr>
<tr>
<td><code><progress></code></td>
<td><progress min="1" max="100" value="60"></progress></td>
<td><progress min="1" max="100" value="60" class="custom"></progress></td>
</tr>
</tbody>
</table>
<div class="bottom">
<button class="btn" id="toggle-theme">Toggle theme</button>
<a href="https://dev.to/dostonnabotov/the-css-accent-color-property-explained-4h9o" target="_blank" rel="noopener noreferrer" class="btn">Read more</a>
</div>
* {
box-sizing: border-box;
}
body {
--brand: #005451;
--text: #121212;
--bg: #fff;
}
body.dark-theme {
--brand: #00ece3;
--text: #fff;
--bg: #1c1b22;
}
.custom {
accent-color: var(--brand);
}
body {
margin: 0;
min-height: 100vh;
position: relative;
display: grid;
/* place-items: center; */
font-family: system-ui, sans-serif;
background-color: var(--bg);
color: var(--text);
overflow: auto;
}
table {
min-width: 600px;
border-collapse: collapse;
}
th,
td {
border: 1px solid #555;
padding: 0.2em 0.5em;
}
.bottom {
display: grid;
gap: 0.25em;
position: absolute;
bottom: 1rem;
right: 1rem;
z-index: 10;
}
.btn {
text-decoration: none;
line-height: 1;
background-color: var(--bg);
border: 1px solid var(--text);
display: inline-block;
padding: 0.5em;
color: var(--text);
font-size: 0.7rem;
border-radius: 0.25em;
text-transform: uppercase;
cursor: pointer;
}
const toggleThemeBtn = document.getElementById("toggle-theme");
toggleThemeBtn.addEventListener("click", () => {
document.body.classList.toggle("dark-theme");
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.