-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(docs): fix showcase layout shift #1727
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(docs): fix showcase layout shift #1727
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -128,7 +138,7 @@ export const users = [ | |||
infoLink: "https://espn.com", | |||
pinned: true, | |||
style: { | |||
widt: 75, |
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.
widt
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.
😂
There's still a tiny shift on preview that I don't have locally - looking into it a bit more |
yep. sounds good. |
8a273c3
to
76d2e17
Compare
Fixed @gaspar09 |
docs/components/clients/Clients.tsx
Outdated
export function Clients({ linked }: { linked?: boolean }) { | ||
const showcaseDark = []; | ||
const showcaseLight = []; | ||
users.forEach((user, idx) => { |
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.
idx
isn't used. do we have lint against unused declarations?for...of
would be nice!
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.
Ah good catch on the idx, will remove since we don't need that for the key.
for...of actually has sub par browser support compared with the array methods, so this and map
are much more common than a traditional for style loop when it comes to the client.
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.
Don't we transpile anyways?
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.
We do, I would still argue forEach is easier to read, and more conventional in this case.
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.
i'm all about the for...of
these days :D, but yeah, for most intents and purposes, it's a stylistic issue.
<Image | ||
src={user.image.replace( | ||
"/logos", | ||
theme === "light" ? "/logos/white" : "/logos/color" |
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.
does this do dark/light mode with JS?
It's possible to do just use html, fwiw <source media="(prefers-color-scheme: dark)" src=...>
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.
It does, I think you need to use picture instead of img for source?
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.
@mehulkar , Can you use that with site preferences?
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.
Nope, prefers-color-scheme
reflects system usage, same as the CSS @media
query.
btw @gaspar09 , I don't use Chrome, so I can't see what you're pointing to with your text fragment links 😛
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.
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.
Did you mean developer.apple.com/safari/technology-preview/??
398c468
to
af53fd0
Compare
I googled why forEach is bad just to play devil's advocate: lol |
btw,
|
Handle logo size correctly and fix showcase layout shift