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

Removed width: 100% from CFPB logo #369

Merged
merged 2 commits into from
Jun 25, 2024
Merged

Removed width: 100% from CFPB logo #369

merged 2 commits into from
Jun 25, 2024

Conversation

ojbravo
Copy link
Collaborator

@ojbravo ojbravo commented Jun 25, 2024

Bug fix for a "squished" CFPB logo on Safari

Copy link

netlify bot commented Jun 25, 2024

Deploy Preview for cfpb-design-system-react ready!

Name Link
🔨 Latest commit ca80bfa
🔍 Latest deploy log https://app.netlify.com/sites/cfpb-design-system-react/deploys/667b17660637900008d8c1d6
😎 Deploy Preview https://deploy-preview-369--cfpb-design-system-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@shindigira shindigira left a comment

Choose a reason for hiding this comment

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

Working!
Screenshot 2024-06-25 at 12 08 40 PM

To explain the issue further:

Chrome
If an asset (such as an image) doesn't have a parent's width set to a specific value, setting it's width to 100% has no affect -- and the asset will use it's natural size (i.e. if a logo is 70px then it's 70px inserted)

Safari
With 100% width, Safari will set an asset (image) to the maximum calculated of the parent while maintaining the aspect ratio.

Long-term solution to avoid this issue is to use an image container with a width of 100% and a set max-width.

@ojbravo ojbravo enabled auto-merge (squash) June 25, 2024 19:17
@ojbravo ojbravo merged commit 9312a84 into main Jun 25, 2024
7 checks passed
@ojbravo ojbravo deleted the safari-logo-styles branch June 25, 2024 19:17
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