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.twigis replaced by themaya:site-headercomponent (components/site-header/). Sub-themes that overrode the include should override the component orpage.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 themaya-headergroup. - 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__ruleandmaya-menu__buttonreplacemaya-menu__dropdownandmaya-menu__children. The active trail is no longer underlined. - The language switcher leaves out the current language and uses
maya-language__chevron-downandmaya-language__chevron-upinstead ofmaya-menu__chevron. - The skip link sits in a
maya-skipwrapper 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,menuandsearchicons intemplates/includes/icon.html.twigare now the filled SF.gov glyphs. New icons:chevron-up,languages,minus,plus.
Footer markup and classes
- 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-nameis gone. site-footer.html.twigtakeslockup_firstandlockup_secondfrommaya_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 header
page-title.html.twigrenders themaya:page-headercomponent. 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 asfield_imageorfield_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-headerand its__hero,__card,__body,__grid,__main,__logo,__figure,__image,__caption,__links,__back,__agencyand__part-ofparts.maya-page-title,maya-page-labelandmaya-page-descriptionstay, without their margins inside the header. - A header with a hero image starts right below the site header (
mainloses its top margin, and the Breadcrumb region moves below the page title block), and.maya-pageclips horizontal overflow (overflow-x: clip) so the hero can span the window. - New icon:
arrow-left.
Alerts and callouts
- Status messages render the
maya:alertcomponent inside<div data-drupal-messages class="maya-messages"><div class="maya-messages__list">. The classesmessages,messages--status,messages--warning,messages--error,messages__icon,messages__content,messages__listandmessages__itemare gone; usemaya-alert,maya-alert--success,--warning,--danger,maya-alert__icon,maya-alert__body,maya-alert__titleandmaya-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.jsreplacesDrupal.theme.message, so messages added withDrupal.Messageuse the same markup. It is added tocore/drupal.messagewithlibraries-extend..maya-calloutis 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__titleandmaya-callout__text. Templates that printed amaya-calloutelement should use themaya:calloutcomponent.css/dist/ckeditor5.cssincludes the callout styles and the icons they use, so CKEditor 5 shows callouts as the page does.- The stroked
info,checkandalerticons intemplates/includes/icon.html.twigare replaced by SF.gov glyphs:infois the filled outline glyph,checkandalertare gone. New icons:archive,caution,checkmark,warning.
Buttons
- Buttons are 40px high (were 52px); add
btn--largefor 52px with 16px text. The primary color isprimary600(wasprimary500). btn--secondaryis now the outline button with aprimary700border and text, light blue on hover. It keeps working;btn--outlineis the new name.- Drupal
.buttonelements that are not primary or danger use the outline style..button--smallis 32px high. maya-chipwas 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-markerand its--large,--andand--orvariants. New components:maya:button,maya:tag,maya:chip.
Forms
- Maya now overrides
form-element.html.twig,form-element-label.html.twigandfieldset.html.twig(intemplates/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
alerticon and an ID the control'saria-describedbypoints 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 withaccent-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_prefixand#field_suffixare wrapped with the control in.form-item__affixand drawn as gray boxes joined to it. The header search's clear button keeps its own look.- The
alerticon is back as the outlined circle with an exclamation mark.
Components
- New:
maya:card,maya:card-group.maya:tilegainsiconanddate;maya:show-moregainsmore_textandless_text;maya:spotlightgainscaption,overlayandimage_position: top. - The 1.x
.maya-cardbox (thecardtile variant and menu tiles in the Home sections region) is now.maya-card-tile;.maya-cardis the new card component. Sub-themes and content that usedclass="maya-card"should switch. - Link tiles: the heading is bold, underlined and
primary600at 16px at every width (was 20px from 1024px,primary500, no underline), as Components-14 p4 and p46–48 show; tiles in a.maya-tile-listhave 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.twigprintsdiv.maya-teaseraround amaya:cardormaya:tileinstead ofarticle.maya-tilewith 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__metaand.maya-tile__bodyclasses 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 rendermaya: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__itemsand.maya-paragraph-grid__itemare now.maya-card-group__heading,__itemsand__item.
Pagers, accordions and tables
- Maya now overrides
pager.html.twigandviews-mini-pager.html.twig. Thepager,pager__itemsandpager__itemclasses are gone; usemaya-pager,maya-pager--mini,maya-pager__pages,maya-pager__page,maya-pager__ellipsis,maya-pager__label,maya-pager__placeholderandmaya-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.twigrenders themaya:detailscomponent. 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.twigandviews-view-table.html.twig, which wrap tables in.maya-table(was.maya-table-wrapperor.views-table-wrapper). Tables are styled only in a.maya-tablewrapper 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.jswraps rich-text tables that CKEditor 5 has not wrapped infigure.table. - Table captions printed by
table.html.twigshow above the table as.maya-table__title.
Rich text
h2in.maya-textis Roboto Slab 20px, 24px from 768px (was 28px, 40px from 1024px).h3reaches 20px at 768px;h4has 36px above and 8px below.- Lists are indented 24px; blockquotes are a gray box with 20px padding and 16px text;
hris 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:eventormaya:location-cardcomponent 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:contactblock 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.twigprints the Content region's blocks up to the page title in a newcontent_headervariable above the columns, then.maya-layoutwith.maya-layout__nav,.maya-layout__contentand.maya-layout__sidebar(werecol-span-full lg:col-span-8andcol-span-full lg:col-span-4divs). Sub-themes that overridepage.html.twigshould printcontent_headerandpage.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-indicatorcomponent (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.twigprints 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. Themaya/filterslibrary adds the year picker to fields marked as years. - Remote video and video file media render
media.html.twigwith themaya:videocomponent, which adds a transcript beside or below the video when the media has a transcript field. maintenance-task-list.html.twig(the installer andupdate.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.twigcontent/media.html.twig,content/node--teaser.html.twig,content/node.html.twig,content/page-title.html.twigdataset/table.html.twigform/fieldset.html.twig,form/form-element.html.twig,form/form-element-label.html.twiglayout/page.html.twig,layout/page--front.html.twig,layout/region--header-language.html.twig(wasregion--header-utilities.html.twig),layout/region--header-search.html.twigmisc/maintenance-task-list.html.twig,misc/status-messages.html.twignavigation/links--language-block.html.twig,navigation/menu--main.html.twig,navigation/menu--section.html.twig,navigation/pager.html.twigparagraphs/paragraph--maya-card.html.twig,paragraphs/paragraph--maya-details.html.twig,paragraphs/paragraph--maya-grid.html.twigviews/views-exposed-form.html.twig,views/views-mini-pager.html.twig,views/views-view-table.html.twigwebform/webform-progress-bar.html.twig,webform/webform-progress-tracker.html.twig