{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"gradient-border-css-rounded-cards-with-padding-box-trick","type":"registry:block","title":"Gradient Border CSS Rounded Cards With Padding Box Trick","description":"Free gradient border CSS that keeps border-radius: three course cards using the padding-box and border-box background trick, in plain CSS and Tailwind.","dependencies":[],"files":[{"path":"components/we-inc/gradient-border-css-rounded-cards-with-padding-box-trick.tsx","type":"registry:component","content":"// Rounded gradient borders with one element each: solid fill clipped to padding-box over a gradient clipped to border-box.\nconst cards = [\n  { title: \"Glaze chemistry\", meta: \"6 weeks, Mondays\", body: \"Mix and test your own stoneware glazes, from celadon to tenmoku.\", grad: \"linear-gradient(135deg,#f97316,#ec4899)\", radius: \"12px\" },\n  { title: \"Throwing large forms\", meta: \"4 weeks, Wednesdays\", body: \"Centre ten kilos of clay and pull walls for planters and jars.\", grad: \"linear-gradient(135deg,#14b8a6,#6366f1)\", radius: \"24px\" },\n  { title: \"Raku firing day\", meta: \"1 day, Saturday\", body: \"Pull glowing pots from the kiln and smoke them in sawdust.\", grad: \"linear-gradient(135deg,#eab308,#16a34a)\", radius: \"36px\" },\n];\n\nexport default function GradientBorderCssRoundedCardsWithPaddingBoxTrick() {\n  return (\n    <section className=\"bg-stone-100 px-5 py-16\">\n      <div className=\"mx-auto max-w-5xl\">\n        <h2 className=\"text-center text-2xl font-semibold tracking-tight text-stone-900\">Courses starting in March</h2>\n        <p className=\"mt-2 text-center text-sm text-stone-600\">Same border trick on three radii: 12, 24 and 36 pixels.</p>\n        <ul className=\"mt-10 grid gap-5 sm:grid-cols-3\">\n          {cards.map((c) => (\n            <li\n              key={c.title}\n              className=\"border-2 border-transparent p-6\"\n              style={{ borderRadius: c.radius, background: `linear-gradient(#fff,#fff) padding-box, ${c.grad} border-box` }}\n            >\n              <p className=\"text-xs font-semibold uppercase tracking-wider text-stone-500\">{c.meta}</p>\n              <h3 className=\"mt-2 text-lg font-semibold text-stone-900\">{c.title}</h3>\n              <p className=\"mt-2 text-sm leading-relaxed text-stone-600\">{c.body}</p>\n              <a href=\"#\" className=\"mt-5 inline-flex min-h-[40px] items-center text-sm font-semibold text-stone-900 underline decoration-stone-300 underline-offset-4 hover:decoration-stone-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stone-900\">\n                Reserve a place\n              </a>\n            </li>\n          ))}\n        </ul>\n      </div>\n    </section>\n  );\n}\n"}]}
