-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: preserve footer social target sizes #2457
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,12 +72,23 @@ | |
| justify-content: center; | ||
| gap: var(--space-6); | ||
|
|
||
| a { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| min-width: var(--size-6); | ||
| min-height: var(--size-6); | ||
| } | ||
|
|
||
| li { | ||
| display: inline; | ||
| } | ||
|
|
||
| svg { | ||
| color: var(--color-icon-primary); | ||
| width: var(--size-4); | ||
| height: var(--size-4); | ||
| flex-shrink: 0; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. width and height is not required for icons, already default size is given to icons. Also I would have put flex-shrink=0 on |
||
| } | ||
|
|
||
| svg path { | ||
|
|
@@ -86,6 +97,8 @@ | |
|
|
||
| @media (--xs-only) { | ||
| padding: var(--space-4) 0 var(--space-6); | ||
| flex-wrap: wrap; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is right approach but need to add this for all view port widths. see issue #2494 (review) |
||
| gap: var(--space-3); | ||
| } | ||
|
|
||
| @media (--md-up) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -242,4 +242,40 @@ test.describe('Homepage Content', () => { | |
| await expect(blueskyLink).toBeVisible(); | ||
| await expect(rssLink).toBeVisible(); | ||
| }); | ||
|
|
||
| test('should preserve minimum social icon and target sizes on narrow screens', async ({ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am +1 on adding tests on target sizes for all the buttons and sidebar. Feel free to open PR's for it. |
||
| page, | ||
| }) => { | ||
| await page.setViewportSize({ width: 390, height: 844 }); | ||
|
|
||
| const footer = page.getByTestId('footer'); | ||
| const measurementTolerance = 0.01; | ||
| const socialLinks = [ | ||
| footer.getByRole('link', { name: /GitHub/i }), | ||
| footer.getByRole('link', { name: /Youtube/i }), | ||
| footer.getByRole('link', { name: /X account/i }), | ||
| footer.getByRole('link', { name: /slack/i }), | ||
| footer.getByRole('link', { name: /Open Collective/i }), | ||
| footer.getByRole('link', { name: /bluesky/i }), | ||
| footer.getByRole('link', { name: /RSS Feed/i }), | ||
| ]; | ||
|
|
||
| for (const link of socialLinks) { | ||
| const linkBox = await link.boundingBox(); | ||
| const iconBox = await link.locator('svg').boundingBox(); | ||
|
|
||
| expect(linkBox).not.toBeNull(); | ||
| expect(iconBox).not.toBeNull(); | ||
| expect(linkBox!.width).toBeGreaterThanOrEqual(24 - measurementTolerance); | ||
| expect(linkBox!.height).toBeGreaterThanOrEqual(24 - measurementTolerance); | ||
| expect(iconBox!.width).toBeGreaterThanOrEqual(16 - measurementTolerance); | ||
| expect(iconBox!.height).toBeGreaterThanOrEqual(16 - measurementTolerance); | ||
| } | ||
|
|
||
| const viewport = await page.evaluate(() => ({ | ||
| clientWidth: document.documentElement.clientWidth, | ||
| scrollWidth: document.documentElement.scrollWidth, | ||
| })); | ||
| expect(viewport.scrollWidth).toBeLessThanOrEqual(viewport.clientWidth); | ||
| }); | ||
| }); | ||
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.
these changes are not required