Tracejado em marcha
Tracejado em marcha: um botão em CSS. Copie as regras, ou o prompt que o reconstrói.
CSS
@property --a104 {
syntax: "<angle>";
inherits: false;
initial-value: 0deg
}
.btn-104 {
position: relative;
font: 500 14px/1 system-ui,sans-serif;
color: #1e3a8a;
background: #eff6ff;
border: 0;
border-radius: 8px;
padding: 13px 22px;
cursor: pointer;
isolation: isolate
}
.btn-104::before {
content: "";
position: absolute;
inset: -2px;
border-radius: 10px;
background: repeating-conic-gradient(from var(--a104),#3b82f6 0 12deg,transparent 12deg 24deg);
z-index: -1;
animation: march104 6s linear infinite
}
.btn-104::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
background: #eff6ff;
z-index: -1
}
.btn-104:hover::after {
background: #dbeafe
}
.btn-104:focus-visible {
outline: 2px solid #3b82f6;
outline-offset: 4px
}
.btn-104:active::after {
background: #bfdbfe
}
@keyframes march104 {
to {
--a104: 360deg
}
}
@media (prefers-reduced-motion: reduce) {
.btn-104, .btn-104 * { animation: none; transition: none; }
}
HTML
<button class="btn-104">Import file</button>Prompt
Um botão azul claro #eff6ff com borda tracejada de 2px feita de um gradiente cônico repetido (segmentos azuis #3b82f6 de 12 graus, intervalos de 12 graus) que gira devagar, de modo que os traços marcham pela borda em 6 segundos. Raio de 8px, texto #1e3a8a de 14px medium, padding de 13px por 22px. Hover #dbeafe, active #bfdbfe, foco com outline azul de 2px e offset de 4px.