A button color chosen from a brand swatch often fails the moment text is placed on it. This page writes a .button rule and a .button:hover rule from a base color, a corner radius, and a style: solid, outline, soft, or hard shadow. Text color is chosen by measuring the base against black and against white, so #427f9c, the opening teal, gets black text. The solid rule is background #427f9c, a 2px border in the same color, 8px corners, and padding 0.625em 1em.
Hover darkens the base and flips the label to white or black based on that darker color. On the opening teal the hover fill is #35667d with white text. Outline keeps the fill transparent and uses the base as the border and the label. Soft tints the fill toward white. Hard shadow adds a 4px offset shadow with no blur, the blunt kind, and still includes the hover.
The class names are .button and .button:hover. Rename them if your stylesheet already uses .button for something else. The page does not write focus rings. Add a visible :focus-visible outline in your own CSS, because a hover change is not a keyboard style.
Base #427f9c, corner radius 8, style solid.
.button { background: #427f9c; color: #000000; border: 2px solid #427f9c; border-radius: 8px; padding: 0.625em 1em; cursor: pointer; } .button:hover { background: #35667d; color: white; }
Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.
Black on #427f9c beats white on the same fill. The page picks the pair with the higher contrast, then rechecks on the hover color.
No. Hover is there. Keyboard focus is yours to add, usually an outline on :focus-visible that does not rely on color alone.
Hard shadow here is a fixed 4px offset with no blur, plus the button colors. The box-shadow page is for arbitrary layers, including spread and transparency.
Raise the radius until it exceeds half the button height. 8px is a slight corner, not a capsule.
The fill is transparent, so the page behind shows through. If that pattern is busy, the label can fail even though the border matches the base.