{
  "id": "draw-border-button",
  "name": "Draw Border Button",
  "category": "buttons",
  "tags": [
    "border",
    "draw",
    "outline",
    "hover",
    "animation",
    "line"
  ],
  "description": "A border that draws itself around the button, one side after another, on hover.",
  "url": "https://copy-css.com/snippets/draw-border-button",
  "markdown": "https://copy-css.com/snippets/draw-border-button.md",
  "html": "<button class=\"btn-draw\">Hover me</button>",
  "css": ".btn-draw {\n  position: relative;\n  padding: 14px 32px;\n  border: 0;\n  background: transparent;\n  box-shadow: inset 0 0 0 2px #e2e8f0;\n  color: #0f172a;\n  font: 600 16px/1 system-ui, sans-serif;\n  cursor: pointer;\n}\n\n.btn-draw::before,\n.btn-draw::after {\n  content: \"\";\n  position: absolute;\n  box-sizing: border-box;\n  width: 0;\n  height: 0;\n  border: 2px solid transparent;\n}\n\n.btn-draw::before {\n  top: 0;\n  left: 0;\n}\n\n.btn-draw::after {\n  right: 0;\n  bottom: 0;\n}\n\n.btn-draw:hover::before,\n.btn-draw:hover::after,\n.btn-draw:focus-visible::before,\n.btn-draw:focus-visible::after {\n  width: 100%;\n  height: 100%;\n}\n\n/* Top, then right... */\n.btn-draw:hover::before,\n.btn-draw:focus-visible::before {\n  border-top-color: #6366f1;\n  border-right-color: #6366f1;\n  transition: width 0.2s ease-out, height 0.2s ease-out 0.2s;\n}\n\n/* ...then bottom, then left */\n.btn-draw:hover::after,\n.btn-draw:focus-visible::after {\n  border-bottom-color: #6366f1;\n  border-left-color: #6366f1;\n  transition: border-color 0s 0.4s, width 0.2s ease-out 0.4s, height 0.2s ease-out 0.6s;\n}\n\n.btn-draw:focus-visible {\n  outline: none;\n}",
  "features": [
    "transitions",
    "box shadows",
    "keyboard focus styles"
  ],
  "customProperties": []
}
