Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kuwait Theme: Add Background Image to Display Group #2589

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

FaithDaka
Copy link
Collaborator

@FaithDaka FaithDaka commented Dec 3, 2024

PR Checklist

  • PR title descriptive (can be used in release notes)

Description

Adds a background_image_asset to feature_display_group component. Link
Also includes display group styling according to the Kuwait theme.

Author Notes

New parameter list:

  • background_image_asset: Adds a background image to the display group.
  • background_image_position: Positions the background image (top, center, bottom). Default top

Further additions

By @jfmcquade:

  1. New display group variant, inline-padding

    • This applies the app-level content padding to the display group content
    • This is required as otherwise when using the display group with sticky set to top or bottom, there is no left or right padding around the content, as demonstrated in example_inline_header_footer:
      Screenshot 2024-12-06 at 18 34 05
    • I did consider alternatives to an explicit variant, e.g. always applying this padding when the display-group is sticky; or always applying this padding when there is a background image set. But these seemed too restrictive on those two scenarios, as we may want to use them without applying padding in this way.
  2. New style param value: background_solid

    • Setting style: background_solid on the display group means that the This was previously the default when setting a display group to sticky (feat: inline header or footer, via 'sticky' display group param #2564), but we agreed that the stickiness should be independent of styles, so this style must now be used in order to prevent the display group from having a transparent background when setting sticky.

See examples in feature_display_group

Git Issues

Closes #2579

Screenshots

Design Kuwait Style

@FaithDaka
Copy link
Collaborator Author

@jfmcquade I tested the concept of adding a margin to the text using the style_list column but given that it requires one to set two values (for top-bottom and left-right) then we don't get the desired effect.
It will be helpful to discuss the need for a spacer component such that space can always be added between components.

@jfmcquade
Copy link
Collaborator

@jfmcquade I tested the concept of adding a margin to the text using the style_list column but given that it requires one to set two values (for top-bottom and left-right) then we don't get the desired effect. It will be helpful to discuss the need for a spacer component such that space can always be added between components.

Thanks for looking into it. Does it not work with margin-top? In theory we should be able to pass any valid CSS to the style_list column so I would have thought that setting margin-top: 48px, for example, could work

@FaithDaka
Copy link
Collaborator Author

Oh, I was using this format: margin: 50px 0px 0px 0px. Using margin-top works fine @jfmcquade

Copy link
Collaborator

@jfmcquade jfmcquade left a comment

Choose a reason for hiding this comment

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

I think the background image options look good.

The changes to the box_primary etc. variants should be pulled into a separate PR I think. I'm not sure whether we want to overwrite the box_* variants for the KW theme or offer new variants. Presumably we're not planning on using the default box_* stylings and so overwriting them may make sense, perhaps @esmeetewinkel can confirm.

Would be good to have those changes broken out into a separate PR for that reason, but if we're sure we're happy to override then they can stay with this PR, but the title and description should be updated.

Copy link

github-actions bot commented Dec 18, 2024

Visit the preview URL for this PR (updated for commit f27841b):

https://plh-teens-app1--pr2589-feature-add-image-at-yeengskb.web.app

(expires Mon, 13 Jan 2025 17:22:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1

Copy link
Collaborator

@esmeetewinkel esmeetewinkel left a comment

Choose a reason for hiding this comment

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

I'm struggling a little to understand from the PR description how the different parameters (are intended to) work.

Clarifications:

  1. I'm understanding that background_image_position can be one of top / center / bottom (vertical position), but can also contain left / right (horizontal position). Default is top + horizontally centred. If this is correct can this be added tot he PR description?

  2. The description of style: background_solid in the PR notes is cut off. This seems to be the default - I don't observe any difference when I do / don't include this parameter. I don't understand how to achieve a transparent background, as in the design:
    image

Bugs:

  1. When the background_image_position is set to top right the image doesn't remain glued to the top on narrow screens.

    Screenity.video.-.Dec.18.2024.1.mp4
  2. The background_image_position left / right should flip in RTL and the background image should be flipped.
    Current view in RTL:
    image

  3. On some screen ratios (e.g. Moto G4 and Samsung Galaxy S8+) I'm seeing a faint blue line underneath the image
    image

  4. I also found [BUG] RTL title alignment #2640, but tracked it separately since it's independent of this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test - preview Create a preview deployment of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add background image attribute to display group
4 participants