Aspect ratio
Keep media at a consistent aspect ratio as its container resizes.
16 : 9
Recommended API
| Property or element | Type | Example initial value | Description |
|---|---|---|---|
aspect-ratio | CSS ratio | 16 / 9 | Reserve proportionate space for media as its width changes. |
States
| State | Trigger | Result |
|---|---|---|
resized | Change the available width. | The height follows the same aspect ratio. |
Svelte implementation guidance
Maintain a configurable width-to-height ratio as the container resizes.
Use semantic HTML and preserve keyboard access. Adapt the example to the project conventions.
CSS variables
| Variable | Type | Default | Description |
|---|---|---|---|
--q-text | color | #28302a | Main text and foreground color. |
--q-muted | color | #70776f | Color for secondary text. |
--q-font-size | length | 13px | Base size for the component text. |
--q-accent | color | #344e41 | Accent for active controls, indicators and focus. |
--q-surface | color | #ffffff | Surface for controls and cards. |
--q-radius | length | 10px | Base corner radius. |
--q-on-accent | color | #ffffff | Foreground on the accent background. |