-
Notifications
You must be signed in to change notification settings - Fork 36
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
DOP-4436: Add explicit height/width for leafy-green icons #1042
Conversation
src/components/Card/index.js
Outdated
|
||
const styles = ['landing', 'product-landing'].includes(template) | ||
? { dim: dim, style: '' } | ||
: { dim: dim, style: compactIconStyle }; | ||
|
||
const styling = [ | ||
cardBaseStyles, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This naming (styles and styling) is going to be confusing. I'd say either rename both of them to be more specific to what piece they're styles for. OR You could simply use dim
as a variable on it's own within the <img>
tag, and then have a one-liner for if the img
needs the compactIconStyle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, TOTAL NIT: could you rename dim
to be slightly more indicative of what it is? iconDimension
or imgDimension
or anything to ensure when we look at this in a few months we have a good idea of what it is without searching
Stories/Links:
DOP-4436
This PR adds explicit height/width attributes to the
<img>
tags nested in components/directives (namely cards and permalinks), so that we can improve our performance as gauged by https://pagespeed.web.dev/. I have included various staging links, which you can run through the aforementioned link and compare the results (under "Image elements do not have explicit width and height") to production. I've also included results for running the test for staging links and production links.Staging Environments
docs-landing
homepage staging link (look at both homepage and Migrators, Tools, and Connectors)
production page speed results
staging page speed results
production MTC results
staging MTC results
cloud-docs landing page
staging link
production results
staging results
drivers landing page (
docs-ecosystem
)idk why the c++ logo is broken but i swear it works in my local environment 😭
staging link
production results
staging results
404 page
staging link
production results
staging results
Notes:
Although the title of the ticket says "leafy-green icons," I didn't touch the actual
Icon
component because 1. I couldn't really find any examples of LeafyGreen Icons in a cursory search of some of the larger properties, 2. the component uses a LeafyGreen icon, not an image, and 3. I figured the impact is likely minimal. Open to any advice, though, since the ticket is slightly ambiguous.README updates