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

Fix: change height and object fit attributes #20246 #20711

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morfenza
Copy link
Contributor

@morfenza morfenza commented Mar 1, 2024

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

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Changes the attributes object-fit and max-height for .crayons-article__cover__image in app/stylesheets/views/articles.scss, the cover image now behaves as expected. Although it is one solution I'd like to discuss possible alternatives!

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

System Specs:

  • OS: Manjaro Linux x86_64
  • Browser: Firefox 122.0 (64-bits)
  • I've used dip to run the application locally

Before the change:

Screenshot from 2024-03-01 10-37-10

After the change:

Screenshot from 2024-03-01 10-46-40

Added/updated tests?

  • Yes
  • No, there is no need
  • I need help with writing tests

@morfenza morfenza requested a review from a team as a code owner March 1, 2024 13:48
@morfenza morfenza requested review from lightalloy and maestromac and removed request for a team March 1, 2024 13:48
Copy link
Contributor

github-actions bot commented Mar 1, 2024

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

@Link2Twenty
Copy link
Contributor

It might be better to use aspect ratio for this

&__image {
      display: block;
      margin: auto;
      max-width: 100%;
      height: auto;
      object-fit: cover;
      aspect-ratio: 50 / 21;
      max-height: calc(
        100vh - var(--header-height) - 2 * var(--layout-padding)
      );
/* rest of code as normal */

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.

Invalid cover photo preview
2 participants