Skip to content

styles: Update "Featured" area on Mayor's page to match designs#2327

Open
millmason wants to merge 8 commits intostagingfrom
mayors-page--featured-styles
Open

styles: Update "Featured" area on Mayor's page to match designs#2327
millmason wants to merge 8 commits intostagingfrom
mayors-page--featured-styles

Conversation

@millmason
Copy link

@millmason millmason commented Sep 17, 2025

What type of PR is this? (check all applicable)

The abbreviated form of the primary type should also be in the PR title
These are the PR types listed in our documentation

  • Feature (feat): A new feature
  • Bug Fix (fix): A bug fix

Description

First step towards incorporating feedback on the Mayor's page (linked below)

This recreates the Featured block designs, which have remove the icon, add background images, and add transparent overlay on hover.

Related Tickets & Documents

Wrike ticket
Design mockups

QA Instructions, Screenshots, Recordings

If you already have philagov.local, you can test this! Pull down this branch, navigate into the phila.gov/wp/wp-content/themes/phila.gov-theme/ directory, and run npm run dev:build. (This assumes that you have already done any necessary npm installs, since setting up philagov.local is beyond what I can explain here.)

You'll also have to go to the admin interface and add a background image for each of the 3 visible featured cards.

Before

No background image, custom colors etc.
Desktop:
Screenshot 2025-09-17 at 2 17 26 PM

Mobile/tablet:
Screenshot 2025-09-15 at 4 39 49 PM

After

Hover overlays and image background working at desktop screenwidths
Screenshot 2025-10-17 at 3 14 35 PM

Hover overlays and image background working at tablet/mobile screenwidths
Screenshot 2025-10-17 at 3 14 53 PM

@millmason millmason changed the base branch from main to staging September 17, 2025 17:50
@millmason millmason marked this pull request as ready for review September 17, 2025 18:19
display: block;

.color-block-card--container {
position: relative;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding position: relative here means that when I position the child as absolute, it will be relative to this element (allowing me to pin the overlay in place)

font-size: 2.5rem;
line-height: 3rem;
color: white;
box-shadow: inset 0 -0.7em 0 0 #0f4d90;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what gives us that thick, offset underline

height: 100%;
width: 100%;
}
a.color-block-card {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of this stuff is just to make everything take up the right amount of space, in spite of being positioned absolute and therefore pulled out of the flow

@include breakpoint(medium down) {
font-size: 2.75rem;
line-height: 2.75rem;
h2 {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are just because of indentation I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mock up is using a different font then what's currently being used. That may correct the spacing issue too.

<?php if (!$action_panel_cta_text == ''): ?>
<div class="copy <?php if ($action_panel_link_loc) echo 'external';?>"><?php echo $action_panel_cta_text; ?></div>
<?php endif; ?>
<div class="color-block-card--container">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a "wrapper" or "container" div which I could use for positioning the overlay.

<?php endif; ?>
</div>
</a>
<div class="color-block-card--background"<?php if (!$action_panel_image == ''): ?> style="background-image: url('<?php echo $action_panel_image; ?>'); background-size: cover; background-repeat: no-repeat;"<?php endif ?>></div>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we conditionally set the background-image via a style tag

@millmason millmason changed the title [Styles]: Update "Featured" area on Mayor's page to match designs [styles] Update "Featured" area on Mayor's page to match designs Sep 18, 2025
@millmason millmason changed the title [styles] Update "Featured" area on Mayor's page to match designs styles: Update "Featured" area on Mayor's page to match designs Sep 18, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need media queries for the top box, the color block bleeds a bit on the bottom.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't think we need the icon's on the images. I didn't see them on the mock up. Just dbl check.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... can you weigh in on this, @m-atia ? The designs aren't showing the logos, but I'm worried it might be an error, because i can see the icons saved as visual assets. If we can remove them, that will resolve the spacing issue, but I want to make sure it's okay to do so

Copy link
Contributor

@lauricekennel24 lauricekennel24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed you will want to require photos for the featured section. Please have Moh or Ritika review the php section.

@millmason
Copy link
Author

As discussed you will want to require photos for the featured section. Please have Moh or Ritika review the php section.

Thank you @lauricekennel24 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants