Problem/Motivation

Though it seems like a no-brainer to have the USWDS-specific classes/divs on the Hero region, it's actually problematic. In order to display a proper USWDS "hero callout" component inside that region, some specific markup is required. And in order to change the background image of the div, some custom CSS is required. This is a great opportunity to abstract out all that markup and CSS into a re-usable mechanism, which is what I've done in uswds_paragraphs. However, if the "usa-hero", "usa-section", and "usa-grid" classes are hardcoded onto that region in the page template, the mechanism (a Paragraph type, in the above case) can not be placed anywhere else.

Proposed resolution

Since a proper hero with callout requires custom markup anyway, I propose to remove the USWDS-specific classes/divs from the Hero region in the page template. Any sites that were currently displaying custom blocks in that region and relying on the class can wrap their custom markup in 2 divs (inner div with "usa-grid", outer div with "usa-hero"), to retain current behavior.

Remaining tasks

Write and review patch.

User interface changes

None.

API changes

None.

Data model changes

Hero region no longer automatically gets the usa-section/usa-hero/usa-grid classes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brockfanning created an issue. See original summary.

brockfanning’s picture

Title: Remove usa-hero from Hero region » Remove usa-section/usa-grid/usa-hero from Hero region
Issue summary: View changes
brockfanning’s picture

Status: Active » Needs review
FileSize
451 bytes
417 bytes

  • brockfanning committed fdff2e3 on 7.x-1.x
    Issue #2895286 by brockfanning: Remove usa-section/usa-grid/usa-hero...

  • brockfanning committed 5656143 on 8.x-1.x
    Issue #2895286 by brockfanning: Remove usa-section/usa-grid/usa-hero...
brockfanning’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.