Use squircle corners with round capsule and checkbox overrides

Wrap the superellipse corner-shape rule in @layer base so utilities can
override it, and add a rounded-full utility that keeps pills and circles
round. Checkbox indicators in the questionnaire opt back into round corners.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
anonymousratwastaken 2026-10-23 19:40:16 +01:00
parent 9295411249
commit 32c91afc00
2 changed files with 16 additions and 6 deletions

View file

@ -123,11 +123,21 @@
--sidebar-ring: oklch(0.552 0.016 285.938);
}
@supports (corner-shape: squircle) {
* {
corner-shape: superellipse(2);
--radius:1.5rem;
}
/* Inside @layer base so utilities like [corner-shape:round] can override it.
Unlayered rules beat every layer, which would make overrides a no-op. */
@layer base {
@supports (corner-shape: squircle) {
* {
corner-shape: superellipse(2);
--radius:1.5rem;
}
}
}
/* Capsule/circle radii stay round: a superellipse corner on a full radius
distorts the pill/circle shape. Merges with Tailwind's built-in rounded-full. */
@utility rounded-full {
corner-shape: round;
}
@layer base {

View file

@ -122,7 +122,7 @@ function QuestionnaireChoice({
<span
aria-hidden="true"
data-slot="questionnaire-choice-indicator"
className="pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary"
className="pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=checkbox]/questionnaire-choice:[corner-shape:round] group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary"
>
<span
data-slot="questionnaire-choice-indicator-dot"