matimh.eu

CSS Button Generator

preview - hover and click it

text contrast 3.96:1 - below 4.5:1, hard to read for some

CSS

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font: 600 15px/1 system-ui, sans-serif;
  color: #ffffff;
  background: #a855f7;
  border: 0px solid #a855f7;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 4px 12px rgb(0 0 0 / 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.14), 0 10px 24px rgb(0 0 0 / 0.18);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 3px;
}

HTML

<button class="btn">Get started</button>

style

corner radius

10px

padding sides

22px

padding top / bottom

12px

font size

15px

border

0px

shadow

hover