Skip to content

feat: [content] allow disabling the <section class="content"> wrapper #809

Open

Description

@ManifoldWanderer

Description

jaspr_content's Content component wraps the rendered page in <section class="content"> (hardcoded in packages/jaspr_content/lib/src/content.dart). There's no way to disable or customize it. Three reasons this would help:

  • Semantic HTML. <section> is sectioning content with implicit outline/landmark semantics, not a generic wrapper. MDN: "section should not be used as a generic container; this is what div is for." An unconditional outer section also affects the document outline and constrains content that uses its own sectioning elements (<article>, nested <section>, <aside> etc.).

  • Cleaner markup. One extra wrapper with no ARIA or structured-data value.

  • CSS direct-child selectors break. Rules like & > :first-child match the section, not the actual first content element:

    @utility prose-trimmed {
      & > :first-child { margin-top: 0; }
      & > :last-child  { margin-bottom: 0; }
    }

    Applied to a parent of the section, this matches the section itself, not the heading inside.

Additional Context

Possible shapes:

  • A bool parameter on ContentApp (e.g. wrapWithContentSection: false).
  • A PageConfig builder that returns the wrapping component, or null to skip.
  • An option on ContentTheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions