Documentation

Upgrading from 1.x

Maya 2.0 rebuilds the theme against SF.gov's 2024 component redesign, starting with a new dark header. This page lists what changes for sites moving from 1.x. Run drush updatedb after updating.

Regions

1.x 2.0
Header utilities (header_utilities) Removed. Use Header language (header_language) and Header search (header_search).
— Alerts (alerts), above the header.
— In-page navigation (page_nav), at the top of the sidebar column from 1024px.

drush updatedb moves the blocks in Header utilities: language switchers to Header language, everything else to Header search. Blocks other than the search form are logged, so you can check that they belong there. Until the update runs, Header utilities stays in the theme as a hidden region, so Drupal does not disable its blocks.

The update also sets main menu blocks in Primary menu that show two levels to three, for headed groups in the menu panels. See Main menu.

Header markup and classes

  • templates/includes/site-header.html.twig is replaced by the maya:site-header component (components/site-header/). Sub-themes that overrode the include should override the component or page.html.twig.
  • The single menu panel and its button (maya-header__panel, maya-header__menu, maya-header__utilities, data-maya-header-toggle, data-maya-header-panel, .is-enhanced, .is-open) are gone. Language, search and menu each have their own <details> toggle below 1024px, in the maya-header group.
  • The branding block renders the seal (maya-branding__seal) and the lockup (maya-branding__lockup) instead of the logo and site name.
  • The main menu panel has new classes: maya-menu__panel, maya-menu__group, maya-menu__heading, maya-menu__links, maya-menu__rule and maya-menu__button replace maya-menu__dropdown and maya-menu__children. The active trail is no longer underlined.
  • The language switcher leaves out the current language and uses maya-language__chevron-down and maya-language__chevron-up instead of maya-menu__chevron.
  • The skip link sits in a maya-skip wrapper that turns header blue while the link has focus.
  • Main content starts 24px below the header (32px from 768px); on the front page, 32px from 1024px.
  • The chevron-down, close, menu and search icons in templates/includes/icon.html.twig are now the filled SF.gov glyphs. New icons: chevron-up, languages, minus, plus.
  • The footer brand shows the seal and the same two-line lockup as the header (maya-footer__lockup, maya-footer__first, maya-footer__second) instead of the site name. maya-footer__site-name is gone.
  • site-footer.html.twig takes lockup_first and lockup_second from maya_preprocess_page(); sub-themes that override it should print them.

Theme settings

The lockup beside the seal, in the header and the footer, comes from two new settings under Appearance > Settings > Maya > Logo image: Logo text, first line (default "City and County of") and Logo text, second line (default "San Francisco"). Sites upgraded from 1.x get these defaults; clear both to show the site name instead.

Other new settings, each with its own section under Appearance > Settings > Maya. All are empty on upgrade, so Maya guesses from field and view mode names until you set them.

Setting Section What it sets
page_header Page header The field for each part of the page header, by content type. See Page header.
teasers Teasers The card variant and image ratio of each teaser view mode. See Node teasers.
node_kinds People, events and places Which content types render as profiles, events or locations. See People, events and places.
in_page_nav In-page navigation The content types that get "Search on this page" and "On this page". See In-page navigation settings.
  • page-title.html.twig renders the maya:page-header component. On node pages it also shows the node's description, logo or image, hero image, back link, primary agency and "Part of" links, taken from fields shown in the full display whose names fit (see Page header). Those fields no longer print in the node's content. Check content types with fields such as field_image or field_summary: to keep one in the content, set its part to "None" under Appearance > Settings > Maya > Page header.
  • Full node views that are not the page's main content (for example a full node in a view) print the header with an h2 instead of the plain title.
  • New classes: maya-page-header and its __hero, __card, __body, __grid, __main, __logo, __figure, __image, __caption, __links, __back, __agency and __part-of parts. maya-page-title, maya-page-label and maya-page-description stay, without their margins inside the header.
  • A header with a hero image starts right below the site header (main loses its top margin, and the Breadcrumb region moves below the page title block), and .maya-page clips horizontal overflow (overflow-x: clip) so the hero can span the window.
  • New icon: arrow-left.

Alerts and callouts

  • Status messages render the maya:alert component inside <div data-drupal-messages class="maya-messages"><div class="maya-messages__list">. The classes messages, messages--status, messages--warning, messages--error, messages__icon, messages__content, messages__list and messages__item are gone; use maya-alert, maya-alert--success, --warning, --danger, maya-alert__icon, maya-alert__body, maya-alert__title and maya-alert__text. Status messages are green and warnings orange, each with an 8px bar on the left; several messages of one type are a plain list.
  • js/messages.js replaces Drupal.theme.message, so messages added with Drupal.Message use the same markup. It is added to core/drupal.message with libraries-extend.
  • .maya-callout is now a box with a 1px blue border and an info icon, not a blue bar on the left. Content with the class keeps working. New classes: maya-callout--info, --success, --warning, --danger, --archived, --heading, maya-callout__icon, maya-callout__title and maya-callout__text. Templates that printed a maya-callout element should use the maya:callout component.
  • css/dist/ckeditor5.css includes the callout styles and the icons they use, so CKEditor 5 shows callouts as the page does.
  • The stroked info, check and alert icons in templates/includes/icon.html.twig are replaced by SF.gov glyphs: info is the filled outline glyph, check and alert are gone. New icons: archive, caution, checkmark, warning.

Buttons

  • Buttons are 40px high (were 52px); add btn--large for 52px with 16px text. The primary color is primary600 (was primary500).
  • btn--secondary is now the outline button with a primary700 border and text, light blue on hover. It keeps working; btn--outline is the new name.
  • Drupal .button elements that are not primary or danger use the outline style. .button--small is 32px high.
  • maya-chip was a small blue tag for links; it is now the filter chip (pill with a border, 30px high). Entity reference links in fields keep the old look.
  • New classes: btn--light, btn--outline, btn--text, btn--arrow, btn--large, btn--icon, maya-link, maya-link--heading, maya-tag, maya-chip, maya-chip--selected, maya-chips, maya-step-marker and its --large, --and and --or variants. New components: maya:button, maya:tag, maya:chip.

Forms

  • Maya now overrides form-element.html.twig, form-element-label.html.twig and fieldset.html.twig (in templates/form/). Sub-themes that copied core's versions should compare them.
  • Descriptions print between the label and the control (they were after it), except invisible ones and those of single checkboxes and radios. Error messages print before the control with an alert icon and an ID the control's aria-describedby points to.
  • The required asterisk is <span class="form-required__marker" aria-hidden="true">*</span> in the label, not .form-required::after. Fields that are not required, in a form with required fields, get <span class="form-optional">(Optional)</span>.
  • Text fields and selects are 56px high (were 44px), with a black border (was neutral400); labels are 20px. Checkboxes and radios are 40px custom boxes (were 20px native controls with accent-color). Fieldsets lose their border and padding. Fields are 36px apart, 60px from 1024px (were 20px), and at most 624px wide. Inline form buttons are 56px high to match.
  • #field_prefix and #field_suffix are wrapped with the control in .form-item__affix and drawn as gray boxes joined to it. The header search's clear button keeps its own look.
  • The alert icon is back as the outlined circle with an exclamation mark.

Components

  • New: maya:card, maya:card-group. maya:tile gains icon and date; maya:show-more gains more_text and less_text; maya:spotlight gains caption, overlay and image_position: top.
  • The 1.x .maya-card box (the card tile variant and menu tiles in the Home sections region) is now .maya-card-tile; .maya-card is the new card component. Sub-themes and content that used class="maya-card" should switch.
  • Link tiles: the heading is bold, underlined and primary600 at 16px at every width (was 20px from 1024px, primary500, no underline), as Components-14 p4 and p46–48 show; tiles in a .maya-tile-list have a 20px margin under their rule (24px from 1024px) instead of the list's gap.
  • Spotlight: headings are 20px below 768px (were 24px), dark teal on green and dark red on orange (were dark blue), body text is black (was dark blue), black spotlights use the light button, and headings longer than 65 characters are cut. The panel's corners are square below 1024px, where it runs edge to edge (was below 768px). A spotlight without an image keeps its text on the left at full width (was right-aligned, at most 65 characters wide).

Teasers and paragraph cards

  • node--teaser.html.twig prints div.maya-teaser around a maya:card or maya:tile instead of article.maya-tile with the display's fields. The card takes its image, description, date and agency from the fields the view mode shows (see Node teasers); other fields follow the description. The .maya-tile, .maya-tile__title, .maya-tile__meta and .maya-tile__body classes are gone.
  • More view modes use it: names containing featured, highlight or news join those starting with teaser or containing card, tile or list.
  • Views whose rows are cards lay them out in the card group grid; rows of news cards and tiles stay stacked.
  • Paragraphs mapped to Card render maya:card (was a bordered box with a "Learn more" arrow link); the whole card links to the link field. Paragraphs mapped to Grid render maya:card-group: the heading is the slab card group heading (was 28px, 40px from 1024px), 3 columns become 2 below 1024px, and .maya-paragraph-grid__heading, .maya-paragraph-grid__items and .maya-paragraph-grid__item are now .maya-card-group__heading, __items and __item.

Pagers, accordions and tables

  • Maya now overrides pager.html.twig and views-mini-pager.html.twig. The pager, pager__items and pager__item classes are gone; use maya-pager, maya-pager--mini, maya-pager__pages, maya-pager__page, maya-pager__ellipsis, maya-pager__label, maya-pager__placeholder and maya-pager__archive. Full pagers show seven page slots from 768px (1 … 4 5 6 … 20) and five below, with Previous and Next as outline buttons and no First or Last links. A mini pager prints the view's More link between Previous and Next.
  • paragraph--maya-details.html.twig renders the maya:details component. Accordions in rich text and Form API details have a 20px bold blue title, plus and minus icons and a gray open panel (were black titles with a chevron).
  • Maya now overrides table.html.twig and views-view-table.html.twig, which wrap tables in .maya-table (was .maya-table-wrapper or .views-table-wrapper). Tables are styled only in a .maya-table wrapper or in rich text (1.x styled every table outside CKEditor). Narrow screens scroll a table sideways with shadows at the cut edges. js/maya.js wraps rich-text tables that CKEditor 5 has not wrapped in figure.table.
  • Table captions printed by table.html.twig show above the table as .maya-table__title.

Rich text

  • h2 in .maya-text is Roboto Slab 20px, 24px from 768px (was 28px, 40px from 1024px). h3 reaches 20px at 768px; h4 has 36px above and 8px below.
  • Lists are indented 24px; blockquotes are a gray box with 20px padding and 16px text; hr is a 2px dotted gray rule.
  • Links styled as buttons (.btn) in rich text keep the button's colors.

People, events and places

  • Teasers of content types that are people, events or places render the maya:profile, maya:event or maya:location-card component instead of a card. Maya guesses the kind from words in the content type's machine name (person, profile, bio, event, meeting, location, …); set People, events and places to change it or set a type to "None".
  • Full node pages gather the address, phone, email, social link and hours fields their display shows into one maya:contact block headed "Contact", printed where the first of them was. Those fields no longer print one by one.
  • Page headers of people show the profile photo in a 220px circle and their pronouns after the title.
  • New color tokens for social networks: neutralFacebook, neutralInstagram, neutralLinkedin, neutralThreads, neutralX, neutralBluesky, neutralTiktok, neutralMastodon, neutralYoutube (see Design tokens).

In-page navigation and page layout

  • With In-page navigation or Sidebar filled, page.html.twig prints the Content region's blocks up to the page title in a new content_header variable above the columns, then .maya-layout with .maya-layout__nav, .maya-layout__content and .maya-layout__sidebar (were col-span-full lg:col-span-8 and col-span-full lg:col-span-4 divs). Sub-themes that override page.html.twig should print content_header and page.page_nav.
  • Menu blocks in In-page navigation render with menu--section.html.twig: a list from 1024px, a dropdown below.

Forms, filters and media

  • Webform's progress bar and tracker render the maya:step-indicator component (webform-progress-bar.html.twig, webform-progress-tracker.html.twig). From 1024px a wizard's progress floats to the right of its fields; Back is a light button and Next a primary one, each with an arrow.
  • Views exposed forms: views-exposed-form.html.twig prints select, checkbox and radio filters as "Filter" dropdowns from 1024px and a "Show filter" accordion below, with the applied filters as removable chips and a Reset link. Multiple-value selects become checkboxes. Text filters, sorts and the form's own buttons stay above. The maya/filters library adds the year picker to fields marked as years.
  • Remote video and video file media render media.html.twig with the maya:video component, which adds a transcript beside or below the video when the media has a transcript field.
  • maintenance-task-list.html.twig (the installer and update.php) renders the step indicator.
  • AJAX throbbers are gray spinning rings; the full-screen one sits on a white circle.

New components

Component Replaces
maya:site-header templates/includes/site-header.html.twig
maya:site-alert —
maya:page-header The page title markup in page-title.html.twig
maya:alert The messages markup in status-messages.html.twig
maya:callout The 1.x .maya-callout bar
maya:button, maya:tag, maya:chip .btn markup; the 1.x .maya-chip tag
maya:details, maya:show-more The <details class="maya-details"> paragraph markup
maya:card, maya:card-group The 1.x card and grid paragraph markup and article.maya-tile teasers
maya:profile, maya:event, maya:agenda-item, maya:timeline, maya:contact, maya:location-card, maya:status-card —
maya:on-this-page, maya:page-search, maya:table-of-contents —
maya:step-indicator, maya:video, maya:social-accounts —

maya:band, maya:spotlight and maya:tile carry over from 1.x. See Components for each one's props and slots.

New template overrides

Sub-themes that override any of these templates, or copied core's version, should compare them with Maya's:

  • block/block--region--alerts.html.twig
  • content/media.html.twig, content/node--teaser.html.twig, content/node.html.twig, content/page-title.html.twig
  • dataset/table.html.twig
  • form/fieldset.html.twig, form/form-element.html.twig, form/form-element-label.html.twig
  • layout/page.html.twig, layout/page--front.html.twig, layout/region--header-language.html.twig (was region--header-utilities.html.twig), layout/region--header-search.html.twig
  • misc/maintenance-task-list.html.twig, misc/status-messages.html.twig
  • navigation/links--language-block.html.twig, navigation/menu--main.html.twig, navigation/menu--section.html.twig, navigation/pager.html.twig
  • paragraphs/paragraph--maya-card.html.twig, paragraphs/paragraph--maya-details.html.twig, paragraphs/paragraph--maya-grid.html.twig
  • views/views-exposed-form.html.twig, views/views-mini-pager.html.twig, views/views-view-table.html.twig
  • webform/webform-progress-bar.html.twig, webform/webform-progress-tracker.html.twig

Edit this page