Clone in a terminal:
styles.css
:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --accent-600: #4f46e5;
    --accent-400: #7c3aed;
    --muted: #6b7280;
    --radius: 12px;
    --space: 18px;
    --max-width: 420px;
    --font-sans: Inter, Avenir, Helvetica, Arial, system-ui, -apple-system;
}

* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(180deg, #f6f8fb 0%, #eef2ff 100%);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

#click-counter {
    width: 100%;
    max-width: var(--max-width);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--card));
    border-radius: calc(var(--radius) + 4px);
    padding: calc(var(--space) * 1.25);
    box-shadow: 0 6px 18px rgba(34, 38, 49, 0.06);
    display: grid;
    grid-template-columns: 1fr; /* single column: counter above, buttons below */
    gap: 14px;
    align-items: center;
    justify-items: center;
    text-align: center;
    border: 1px solid rgba(16, 24, 40, 0.03);
}

.click-counter-display {
    font-weight: 700;
    font-size: 3.2rem;
    line-height: 1;
    padding: 20px 28px;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(124, 58, 237, 0.08),
        rgba(79, 70, 229, 0.04)
    );
    color: var(--accent-600);
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(34, 38, 49, 0.06);
    user-select: none;
}

.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

button[class^="click-counter-"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-radius: 10px;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.click-counter-increment-button,
.click-counter-decrement-button {
    background: linear-gradient(90deg, var(--accent-400), var(--accent-600));
    color: white;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
    border: none;
}

@media (min-width: 520px) {
    #click-counter {
        gap: 18px;
    }

    .click-counter-display {
        font-size: 3.5rem;
        min-width: 180px;
    }

    button[class^="click-counter-"] {
        min-width: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
}

.small {
    font-size: 0.9rem;
    color: var(--muted);
}

.click-counter-display {
    border: solid 10px var(--accent-400);
}

File history (3 commits)

de1d478 Johan Mattsson - johan.mattsson.m@gmail.com
Styling
Styling
5736913 Johan Mattsson - johan.mattsson.m@gmail.com
Style in example
Style in example
bf5df00 Johan Mattsson - johan.mattsson.m@gmail.com
Clock counter example
Clock counter example

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112