Button Library · Signature
8-Bit
Stepped corners and hard moves, a cursor blinks on hover.
States
Default
Hover
Active
Focus
Code
sig-pixel.html
<button class="btn-sig-pixel" type="button"> <span>Press start</span> </button>
sig-pixel.css
.btn-sig-pixel {
--btn-bg: #2e9e6b;
--btn-fg: #ffffff;
--btn-font: ui-monospace, monospace;
--btn-size: 14px;
--btn-weight: 600;
--btn-px: 20px;
--btn-py: 14px;
--btn-w: auto;
--btn-h: auto;
--btn-bw: 0px;
--btn-line: #8b6cff;
--btn-radius: 0px;
}
.btn-sig-pixel {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5em;
box-sizing: border-box;
width: var(--btn-w);
height: var(--btn-h);
padding: var(--btn-py) var(--btn-px);
font-family: var(--btn-font);
font-size: var(--btn-size);
font-weight: var(--btn-weight);
line-height: 1.2;
color: var(--btn-fg);
background: var(--btn-bg);
border: var(--btn-bw) solid var(--btn-line);
border-radius: var(--btn-radius);
box-shadow: inset -4px -4px 0 color-mix(in srgb, var(--btn-bg) 62%, #000), inset 4px 4px 0 color-mix(in srgb, var(--btn-bg) 72%, #fff);
cursor: pointer;
text-decoration: none;
white-space: nowrap;
transition: none;
clip-path: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
letter-spacing: 0.06em;
text-transform: uppercase;
}
.btn-sig-pixel:focus-visible {
outline: 2px solid var(--btn-fg);
outline-offset: -6px;
}
.btn-sig-pixel:disabled {
opacity: 0.5;
pointer-events: none;
}
.btn-sig-pixel__icon {
width: 1.15em;
height: 1.15em;
flex-shrink: 0;
}
.btn-sig-pixel::before {
content: "▶";
font-size: 0.7em;
opacity: 0;
}
.btn-sig-pixel:hover::before {
opacity: 1;
animation: btn-blink 700ms steps(2, jump-none) infinite;
}
.btn-sig-pixel:active {
transform: translateY(4px);
box-shadow: inset 4px 4px 0 color-mix(in srgb, var(--btn-bg) 62%, #000), inset -4px -4px 0 color-mix(in srgb, var(--btn-bg) 72%, #fff);
}
@keyframes btn-blink {
from { opacity: 1; }
to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.btn-sig-pixel,
.btn-sig-pixel::before {
animation: none !important;
transition: none !important;
}
}
sig-pixel.js
// No JavaScript needed: this one is CSS only.
sig-pixel.tsx
import type React from "react";
import "./sig-pixel.css"; // the CSS tab
export function BtnSigPixel({ children = "Press start", ...props }: React.ComponentProps<"button">) {
return (
<button className="btn-sig-pixel" type="button" {...props}>
<span>{children}</span>
</button>
);
}
sig-pixel.html
<button class="relative inline-flex items-center justify-center gap-[0.5em] [box-sizing:border-box] [padding:14px_20px] [font-family:ui-monospace,_monospace] text-[14px] font-[600] [line-height:1.2] text-[#ffffff] bg-[#2e9e6b] [border:0px_solid_#8b6cff] rounded-[0px] [box-shadow:inset_-4px_-4px_0_color-mix(in_srgb,_#2e9e6b_62%,_#000),_inset_4px_4px_0_color-mix(in_srgb,_#2e9e6b_72%,_#fff)] cursor-pointer no-underline whitespace-nowrap [transition:none] [clip-path:polygon(0_8px,_4px_8px,_4px_4px,_8px_4px,_8px_0,_calc(100%_-_8px)_0,_calc(100%_-_8px)_4px,_calc(100%_-_4px)_4px,_calc(100%_-_4px)_8px,_100%_8px,_100%_calc(100%_-_8px),_calc(100%_-_4px)_calc(100%_-_8px),_calc(100%_-_4px)_calc(100%_-_4px),_calc(100%_-_8px)_calc(100%_-_4px),_calc(100%_-_8px)_100%,_8px_100%,_8px_calc(100%_-_4px),_4px_calc(100%_-_4px),_4px_calc(100%_-_8px),_0_calc(100%_-_8px))] [letter-spacing:0.06em] [text-transform:uppercase] focus-visible:[outline:2px_solid_#ffffff] focus-visible:[outline-offset:-6px] disabled:[opacity:0.5] disabled:[pointer-events:none] before:content-['▶'] before:text-[0.7em] before:[opacity:0] hover:before:[opacity:1] hover:before:[animation:btn-blink_700ms_steps(2,_jump-none)_infinite] active:[transform:translateY(4px)] active:[box-shadow:inset_4px_4px_0_color-mix(in_srgb,_#2e9e6b_62%,_#000),_inset_-4px_-4px_0_color-mix(in_srgb,_#2e9e6b_72%,_#fff)] motion-reduce:[transition:none!important] motion-reduce:before:[animation:none!important]" type="button">
<span>Press start</span>
</button>
<!-- A class cannot hold keyframes: keep this in your CSS. -->
<style>
@keyframes btn-blink {
from { opacity: 1; }
to { opacity: 0; }
}
</style>