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

Add CSS styling variable options into lead-image card #3

Open
dmnewcomb opened this issue Apr 1, 2024 · 3 comments
Open

Add CSS styling variable options into lead-image card #3

dmnewcomb opened this issue Apr 1, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@dmnewcomb
Copy link
Contributor

Overview

The lead-image card defaults to a vertical view on mobile. The image fills up the space accordingly by using object-fit: cover but the image does get cropped in various ways that might not work great. We should allow users to edit this.

Default w/ object-position: 50% 50%; cuts off football
Screenshot 2024-04-01 at 9 49 07 AM

Edited to have object-position: 37% 50%; may be slightly better on most mobile formats
Screenshot 2024-04-01 at 10 04 09 AM

Recommended Solution

We have some control over what gets cropped on mobile through the object-position CSS property, and for the custom element we already have CSS variables to control this: --lead-image-object-position-horizontal-mobile and --lead-image-object-position-vertical-mobile.

We just need to add the ability to edit these CSS variables within the no-code tool.

For simplicity, for the object-position variables, I think we should allow the user to set a range from 0% to 100%. Looking at --podcast-grid-max-width (another CSS variable, for the podcast-grid custom element) in the menu-dev.js file could provide a reasonable example of how to enable this type feature within the no-code tool.

@dmnewcomb dmnewcomb added the enhancement New feature or request label Apr 1, 2024
@dmnewcomb dmnewcomb assigned dmnewcomb and isaiahboyd and unassigned dmnewcomb Apr 1, 2024
@dmnewcomb
Copy link
Contributor Author

Instead of looking at the podcast grid example (no longer supported in the tool), take a look at the lead-video example with --lead-video-header-max-width

@dmnewcomb
Copy link
Contributor Author

@dmnewcomb
Copy link
Contributor Author

To load up the menu-dev.js config, this is the link you need for testing:
http://localhost:5173/#/enhance?mode=dev-dd5b655d-3922-4dfa-ab94-b80a1a58b168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants