mantra_starter audit: fix inconsistencies, unused code, responsive and accessibility issues

Task type
Project
Changed

Context

Audit of web/themes/custom/mantra_starter made on 2026-11-11. Paths below are relative to the theme. Line numbers are from the day of the audit and may have moved since.

What was checked

  • Every CSS, JS, Twig, component and PHP file in the theme was read.
  • A fresh vite build was compared with the committed dist/.
  • Stylelint and ESLint were run over the theme.
  • 13 pages on theme, retrograde and contrib were loaded at 320, 375, 768, 1024 and 1440px, logged out and logged in, and scanned with axe-core (WCAG 2.2 AA plus best practice).

Results in brief

  • No page tested overflowed horizontally at any width.
  • Axe reported:
    • target-size (serious, 96 nodes)
    • listitem and list on admin pages
    • landmark-unique on pages with sidebars
    • page-has-heading-one on front pages
    • heading-order (the pager's <h4>)
    • label-title-only
  • Axe found no color-contrast failures on the pages it scanned. The contrast problems listed below are in states and modules it didn't reach.

The full report, with about 250 findings, is in the local checkout at scratchpad/theme-audit/REPORT.md, with screenshots and the raw axe output beside it.

TODO

Fix first

@apply

    • hero.css, card.css:25, branding.css, elements.css, links.css, typography.css
    • drd.css, reference.css, formtips.component.css, chosen.theme.css, ckeditor-code.css
    • page_header.css, page_footer.css, page.css, menu.css, responsive_menu.css, views.css:86-89

    The @property descriptors these leak still sit in 8 dist/ files.

Build and tokens

    • --background-color-lighter, --background-color, --text-color, --font-family-monospace, --link-decoration
    • --ck-fucus-ring (typo)

Unused code

Responsive

Accessibility

PHP, templates, components

Docs

Done

How each step was checked: after every step the theme was rebuilt, and the final value of every margin, padding, gap and display property in the built CSS was compared, rule by rule, with the build from before any of this work. Stylelint was run on the changed files before and after each step. Caches were cleared on theme, retrograde and contrib.

    • tabs, form, todo-list, breadcrumbs, field, details
    • views, system-admin.component, system.admin.theme, dialog, field-ui-add-field_module.component, views_ui.admin.theme, media-library
    • facets, card, screenshot, content_w_sidebar

    The built CSS has the same values as before. The only differences:

    • margin-inline: 0 was dropped on nav.tabs, .breadcrumb, .comment-wrapper and .table-filter, which have no default side margins.
    • .views-row now gets 1rem directly. Its theme('spacing.DEFAULT') call is gone.

    @apply lines are placed where the project's stylelint ordering rules want them.

    • form, breadcrumbs, field, views_ui.admin.theme, media-library, system-admin.component, screenshot
    • menu_link, block-admin.theme, ckeditor, dropbutton, layout-builder.theme, autocomplete, button, icons, item-list, tablesort
    • chosen.theme, drd, fullcalendar

Not committed yet. Commit the source files together with the rebuilt dist/*.css.