--- import type { CollectionEntry } from 'astro:content' import { getConfig } from '@libs/config' import GitHubIcon from '@components/icons/GitHubIcon.astro' import MdnIcon from '@components/icons/MdnIcon.astro' import CssTricksIcon from '@components/icons/CssTricksIcon.astro' interface Props { frontmatter: CollectionEntry<'docs'>['data'] filePath?: string } const { frontmatter, filePath } = Astro.props const layerLabels: Record = { reboot: 'Reboot', layout: 'Layout', content: 'Content', forms: 'Forms', components: 'Components', helpers: 'Helpers', utilities: 'Utilities' } const layerTooltips: Record = { reboot: 'Scoped to the Reboot CSS layer', layout: 'Scoped to the Layout CSS layer', content: 'Scoped to the Content CSS layer', forms: 'Scoped to the Forms CSS layer', components: 'Scoped to the Components CSS layer', helpers: 'Scoped to the Helpers CSS layer', utilities: 'Scoped to the Utilities CSS layer' } const deps = frontmatter.deps ?? [] const depsCount = deps.length const depsTitles = deps.map((dep) => dep.title).join(', ') ---
{ frontmatter.js === 'required' && (
Requires JS
) } { frontmatter.js === 'optional' && (
JS Optional
) } { frontmatter.css_layer && (
Layer: {frontmatter.css_layer}
) } { frontmatter.css_media === 'container' && (
Container queries
) } { frontmatter.css_media === 'viewport' && (
Viewport queries
) } { depsCount > 0 && (
{depsCount} {depsCount === 1 ? 'dependency' : 'dependencies'}
) } { frontmatter.added && (frontmatter.added.show_badge === undefined || frontmatter.added.show_badge === true) && (
Added in v{frontmatter.added.version}
) } { frontmatter.mdn && ( ) } { frontmatter.csstricks && ( ) } { filePath && ( ) }