<!--
  GENERATED FILE - do not edit by hand.
  Source of truth: src/components/mds-card-content/usage/ in the magma monorepo.
-->

# mds-card-content - mistakes

> The API of this component: [`AGENTS.md`](AGENTS.md).

Common incorrect uses of `<mds-card-content>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.

#### Do Not Use `<mds-card-content>` Outside `<mds-card>`

`<mds-card-content>` is a compound child and relies on `<mds-card>`'s slot infrastructure and grid layout. Used standalone it renders with no container context and produces unpredictable visual output.

```html
<!-- INCORRECT -->
<mds-card-content>
  <mds-text typography="paragraph">Testo senza contesto.</mds-text>
</mds-card-content>

<!-- CORRECT -->
<mds-card>
  <mds-card-content>
    <mds-text typography="paragraph">Testo senza contesto.</mds-text>
  </mds-card-content>
</mds-card>
```

#### Do Not Set the `slot` Attribute Manually

`<mds-card-content>` self-assigns `slot="content"` in its `Host` render. Adding the attribute externally is redundant: the component writes it itself, overwriting any other value when it renders.

```html
<!-- INCORRECT -->
<mds-card>
  <mds-card-content slot="content">
    <mds-text typography="paragraph">Intestazione sezione principale.</mds-text>
  </mds-card-content>
</mds-card>

<!-- CORRECT -->
<mds-card>
  <mds-card-content>
    <mds-text typography="paragraph">Intestazione sezione principale.</mds-text>
  </mds-card-content>
</mds-card>
```

#### Do Not Replace `<mds-card-content>` with a Raw `<div slot="content">`

A raw element placed directly in `slot="content"` bypasses the card-content component's internal grid and the rhythm of its children, and the card, which infers its grid from the tag names of its children, does not recognise it as the content region: the managed layout breaks.

```html
<!-- INCORRECT -->
<mds-card>
  <div slot="content" style="padding: 16px;">
    <p>Descrizione pratica edilizia.</p>
  </div>
</mds-card>

<!-- CORRECT -->
<mds-card>
  <mds-card-content>
    <mds-text typography="paragraph">Descrizione pratica edilizia.</mds-text>
  </mds-card-content>
</mds-card>
```

#### Do Not Try to Style Spacing via `<mds-card-content>` CSS Vars

`<mds-card-content>` exposes no `--mds-card-content-*` custom properties. Setting them has no effect: it has no padding (the inset is the card's) and its gap is `--magma-rhythm-title-content`. The spacing you can set is the card's, through `--mds-card-gap` (between the regions) and `--mds-card-padding` (around them) on the parent `<mds-card>`, with a rhythm role.

```css
/* INCORRECT - has no effect */
mds-card-content {
  --mds-card-content-padding: calc(var(--spacing) * 600);
  --mds-card-content-gap: calc(var(--spacing) * 400);
}

/* CORRECT - set on the parent card host, with a rhythm role */
mds-card {
  --mds-card-gap: var(--magma-rhythm-between-fields);
}
```

#### Do Not Place Multiple `<mds-card-content>` Elements in One Card

Only one content region per card is supported. Multiple instances produce overlapping slot assignments and unpredictable grid output; consolidate all body content inside a single `<mds-card-content>`.

```html
<!-- INCORRECT -->
<mds-card>
  <mds-card-content>
    <mds-text typography="label">Sezione A</mds-text>
  </mds-card-content>
  <mds-card-content>
    <mds-text typography="label">Sezione B</mds-text>
  </mds-card-content>
</mds-card>

<!-- CORRECT -->
<mds-card>
  <mds-card-content>
    <mds-text typography="label">Sezione A</mds-text>
    <mds-text typography="label">Sezione B</mds-text>
  </mds-card-content>
</mds-card>
```
