Skip to content

Instantly share code, notes, and snippets.

@xhsdnn
Last active April 16, 2024 11:53
Show Gist options
  • Save xhsdnn/b17c0e88ba2f5ca6d32e41ef833e1889 to your computer and use it in GitHub Desktop.
Save xhsdnn/b17c0e88ba2f5ca6d32e41ef833e1889 to your computer and use it in GitHub Desktop.
按钮按下触感样式
/*
* reference: https://learn.svelte.dev/tutorial/dom-event-forwarding
*/
button {
font-size: 1.4em;
width: 6em;
height: 6em;
border: none;
border-radius: 50%;
background: radial-gradient(circle at 25% 25%, hsl(0, 100%, 50%) 0, hsl(0, 100%, 40%) 100%);
box-shadow: 0 8px 0 hsl(0, 100%, 30%), 2px 12px 10px rgba(0,0,0,.35);
color: hsl(0, 100%, 30%);
text-shadow: -1px -1px 2px rgba(0,0,0,0.3), 1px 1px 2px rgba(255,255,255,0.4);
text-transform: uppercase;
letter-spacing: 0.05em;
transform: translate(0, -8px);
transition: all 0.2s;
}
button:active {
transform: translate(0, -2px);
box-shadow: 0 2px 0 hsl(0, 100%, 30%), 2px 6px 10px rgba(0,0,0,.35);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment