This project is not covered by Drupal’s security advisory policy.

A Drupal theme for Web Awesome, ready to be used by Display Builder. Display Builder first, but not required.

In alpha. The first components are the ones the Display Builder interface uses: button, button group, icon, tooltip, dropdown, dropdown item, divider, card, avatar, alert, toast container, toast, input and checkbox.

Site blocks: accordion, breadcrumb, pagination, carousel, details, tabs, modal, offcanvas and badge. A button opens a modal with the attribute data-dialog="open MODAL_ID", an offcanvas with data-drawer="open OFFCANVAS_ID".

As the default theme, it gives pages Web Awesome's look, switches to dark mode with UI Skins, and offers three breakpoints to Display Builder's viewport switcher. Web Awesome's styles for bare HTML elements load on every page except the HTMX fragments Display Builder swaps in and its admin pages, so its Builder iframe and previews get them. Status messages, pagers and the breadcrumb use Web Awesome components, local tasks a row of links. Pagers print Web Awesome's native buttons, a.wa-button, so Views' AJAX pagers bind them.

A page component, for Display Builder page layouts, gives a full page: banner, header, navigation, main content, aside and footer. Nothing is sticky unless chosen. Below the mobile breakpoint the navigation becomes a drawer, opened by any element with the attribute data-toggle-nav.

The components load Web Awesome 3.14.0 by themselves, so they also work while another theme is the default one. They load it from the jsDelivr CDN, unless the source is Local and Web Awesome, or a sub-theme of it, is the active theme. They leave the page's own font and colors alone. webawesome/native adds Web Awesome's styles for bare HTML elements: opt in only, they reach the whole page.

For a full description of the theme, visit the project page.

Submit bug reports and feature suggestions, or track changes in the issue queue.

Requirements

  • Drupal 11.4.8 or later.
  • Optional: UI Patterns 2, for the component stories, typed props and sources.

Installation

Install as you would normally install a contributed Drupal theme. For further information, see Installing Drupal Themes.

Local source

By default the files load from the jsDelivr CDN. To serve them from your site, download the npm package, which asset-packagist does not offer, and unpack its package/ folder as web/libraries/webawesome, so that dist-cdn/ sits at /libraries/webawesome/dist-cdn/:

npm pack @awesome.me/webawesome@3.14.0
mkdir -p web/libraries/webawesome
tar xzf awesome.me-webawesome-3.14.0.tgz --strip-components=1 -C web/libraries/webawesome

Then pick Local in the theme settings. The option shows only when webawesome.loader.js exists there. The choice applies while Web Awesome, or a sub-theme of it, is the active theme. A sub-theme reads its own setting.

With the local source, wa-icon reads Font Awesome Free's SVG files from /libraries/fortawesome--fontawesome-free/svgs, the package the icon packs below use, and never calls ka-f.fontawesome.com. Free has no light, thin or duotone styles. With the CDN source the icon component still fetches from Font Awesome's CDN, wa-icon's default library.

Icons

The theme defines three icon packs for the core Icon API, from Font Awesome Free 7.3.1:

  • webawesome_font_awesome_solid
  • webawesome_font_awesome_regular
  • webawesome_font_awesome_brands

The theme bundles none of it. The packs read SVG files from /libraries/fortawesome--fontawesome-free:

composer require npm-asset/fortawesome--fontawesome-free:^7.3

The site needs asset-packagist as a Composer repository, and an installer-paths entry that maps npm-asset packages to web/libraries/{$name}.

Font Awesome Free icons are CC BY 4.0. The attribution comment stays in the SVG files under /libraries. Do not strip it.

Display Builder

  • config/optional holds a webawesome profile and a webawesome page layout. They install with Display Builder. The page layout applies to pages in the Web Awesome theme, through the current theme condition. It needs Display Builder Page Layout, UI Patterns and Generic Components. Its page component holds a header with the branding and the main menu, the page parts in the content, and a footer.
  • config/optional also holds 15 presets: hero, call to action, card grid, features, FAQ, pricing, four column layouts, site header, site footer, page frame, article header and article teaser. The theme does not need Generic Components, but every preset is built from its HTML wrappers, so the presets install only with it. The article header needs the article content type, the article teaser also its body field. The page frame needs Display Builder Page Layout.
  • webawesome.ui_styles.yml holds 15 styles for UI Styles: layout, gap, alignment, wrap, color variant, invert, typography and border radius. The Layout style takes one utility at a time: Web Awesome matches its layout classes by substring, so a second one would clash.
  • Presets and styles use Web Awesome's utility classes. Those load from the theme's info file, so they apply only while Web Awesome, or a sub-theme of it, is the active theme.

Trademark

This theme is a community project. It is not affiliated with, sponsored by or endorsed by Fonticons, Inc. "Web Awesome" and its logos are trademarks of Fonticons, Inc. Web Awesome Core is used under the MIT license.

Maintainers

Support

Enjoying this project? Back my open source work on Liberapay: every contribution keeps it maintained.

Need a feature, a fix or a hand on your Drupal project? I take sponsored work and freelance missions. Let's talk.

Project information

Releases