Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

Pastel button

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By @anucodes

Remix button

Button submission checks

Checks will appear after the preview updates.

Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.

Accessibility quick check

Waiting for the rendered preview…

Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.

Explore freely here. Remix to publish your version with credit to the creator.

About Pastel button

Pastel button is an animated CSS button by @anucodes. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects
Using this example
Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./style.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700&family=Lato:wght@100&family=Lexend+Deca&display=swap" rel="stylesheet"> 
    <title>Pastel button</title>
</head>



<body>
    <button type="button" class="shadow">Hover me</button>
</body>
</html>

CSS


html,
body {
  margin: 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  font-family: "Lato";
}

button {
  margin: 50px;
  font-family: inherit;
}

.shadow {
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 2px;
  padding: 13px 50px 13px;
  outline: 0;
  border: 1px solid black;
  cursor: pointer;
  position: relative;
  background-color: rgba(0, 0, 0, 0);
}

.shadow::after {
  content: "";
  background-color: #F8C8DC;
  width: 100%;
  z-index: -1;
  position: absolute;
  height: 100%;
  top: 8px;
  left: 8px;
  transition: 0.2s;
}

.shadow:hover::after {
  top: 0px;
  left: 0px;
}