diff --git a/src/components/Card/_card.scss b/src/components/Card/_card.scss new file mode 100644 index 0000000..379567a --- /dev/null +++ b/src/components/Card/_card.scss @@ -0,0 +1,53 @@ +@use "../../styles/tokens/typography" as *; + +.card { + display: flex; + flex-direction: column; + background-color: var(--nds-surface); + border: var(--nds-border-width-thin) solid var(--nds-border); + border-radius: var(--nds-radius-lg); + overflow: hidden; + box-shadow: var(--nds-shadow-sm); + width: fit-content; + transition: + box-shadow 160ms ease, + border-color 160ms ease; + &:hover { + box-shadow: var(--nds-shadow-md); + } + + &__cover { + height: 150px; + background-position: center; + background-size: cover; + background-repeat: no-repeat; + } + &__body { + display: flex; + flex-direction: column; + gap: var(--nds-spacing-xs); + padding: var(--nds-spacing-md); + } + &__title { + @include text-xl; + color: var(--nds-text); + margin: 0; + } + &__subtitle { + @include text-base; + color: var(--nds-neutral); + margin: 0; + } + &__content { + @include text-base; + color: var(--nds-text); + &:empty { + display: none; + } + } + &__footer { + margin-top: var(--nds-spacing-2xs); + display: flex; + gap: var(--nds-spacing-xs); + } +} diff --git a/src/components/Card/card.astro b/src/components/Card/card.astro new file mode 100644 index 0000000..276b96d --- /dev/null +++ b/src/components/Card/card.astro @@ -0,0 +1,33 @@ +--- +export interface Props { + title?: string; + subtitle?: string; + cover?: string; +} +const { title, subtitle, cover } = Astro.props; +const hasFooter = Astro.slots.has("footer"); +--- + +
{title}
} + {subtitle &&{subtitle}
} +Variants, sizes, icon and disabled states.
-Tones × soft / solid.
-Selection controls in every state.
-Text, email, password, textarea.
-Default and disabled.
-Increment / decrement control.
-Photo and initials.
-Determinate and indeterminate.
-Title and subtitle rows.
-Inline and external.
-Underline tabs with panels.
-🖼️ Image gallery content.
🎬 Video player here.
📄 Document list here.
🖼️ Image gallery content.
🎬 Video player here.
📄 Document list here.
Hierarchical navigation.
-Page numbers with disabled edges.
-Info, success, warning and error.
-Four positions — hover the buttons.
-With cover, plain and with footer.
-App chrome.
- -Overlay dialog.
-Library at 24px, plus arrow orientations and sizes.
-+ Library at 24px, plus arrow orientations and sizes. +
+