{
  "id": "close-button",
  "name": "Close Button",
  "category": "buttons",
  "tags": [
    "x icon",
    "dismiss",
    "modal",
    "dialog",
    "cross"
  ],
  "description": "An accessible X close button for modals, toasts and banners, with a soft hover background.",
  "url": "https://copy-css.com/snippets/close-button",
  "markdown": "https://copy-css.com/snippets/close-button.md",
  "html": "<button class=\"btn-close\" aria-label=\"Close\">\n  <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 6l12 12M18 6 6 18\"/></svg>\n</button>",
  "css": ".btn-close {\n  display: inline-grid;\n  place-items: center;\n  width: 36px;\n  height: 36px;\n  padding: 0;\n  border: 0;\n  border-radius: 10px;\n  background: transparent;\n  color: #52525b;\n  cursor: pointer;\n  transition: background-color 0.15s ease, color 0.15s ease;\n}\n\n.btn-close svg {\n  width: 20px;\n  height: 20px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 2.2;\n  stroke-linecap: round;\n}\n\n.btn-close:hover {\n  background: #f4f4f5;\n  color: #18181b;\n}\n\n.btn-close:active {\n  background: #e4e4e7;\n}\n\n.btn-close:focus-visible {\n  outline: 2px solid #18181b;\n  outline-offset: 2px;\n}",
  "features": [
    "transitions",
    "CSS Grid",
    "keyboard focus styles"
  ],
  "customProperties": []
}
