FlixBotDev
Login
← Retour galerie

Boutons · html-css · intermediate

Deploy Run

Bouton sombre avec bordure gradient animée (acid / cyan / violet)

Ouvrir Studio

Aperçu live

Code

:root {
  --ink: #050607;
  --acid: #c8ff3d;
  --violet: #7b5cff;
  --cyan: #3de8ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.btn-run {
  position: relative;
  padding: 1rem 2.2rem;
  border: none;
  border-radius: 14px;
  background: #0c0e12;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  overflow: hidden;
  z-index: 0;
}

.btn-run::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--angle, 0deg),
    var(--acid),
    var(--cyan),
    var(--violet),
    var(--acid)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 2.5s linear infinite;
}

.btn-run span {
  position: relative;
  z-index: 1;
}

.btn-run:hover {
  box-shadow: 0 0 40px rgba(200, 255, 61, 0.25);
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin {
  to {
    --angle: 360deg;
  }
}

Envie de tweak les tokens ? Code Studio