Skip to content

fix: mobile styles on documentation page and missing react key #3380

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

connorb08
Copy link
Contributor

fixes: #3270

@connorb08
Copy link
Contributor Author

@connorb08 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@jakebailey jakebailey added the deploy-preview Enables automatic deployments to preview environments on a PR label May 4, 2025
@@ -48,6 +48,19 @@
flex-direction: row;
width: 100%;

aside.handbook-toc {
@media (max-width: 999px) {
Copy link
Member

Choose a reason for hiding this comment

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

Where did 999 come from? Are you sure this shouldn't be one of the size constants from https://github.com/microsoft/TypeScript-Website/blob/v2/packages/typescriptlang-org/src/style/globals.scss?

999 does work on my phone (yay), but I'm trying to understand if it'll work for everyone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used 999 because that is the breakpoint in the stylesheet where it turns from a flex row into a column. You are right though, it definitely makes more sense to use the xs breakpoint, I updated the PR to use that instead.

It would work either way because the fix is in the .whitespace.raised style, but adding the padding just makes it look better / more readable on a mobile screen so the text doesn't go all the way to the edge.

Copy link
Member

Choose a reason for hiding this comment

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

Not sm, like the others here? xs is 480px, so I'm just trying to figure out what is and isn't right as (honestly) not a CSS expert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, the media query on lines 28-30 uses the xs breakpoint to remove the padding for the content.

At 500px, the page has padding around the content:
image

Without the padding, when you shrink the page, the text goes all the way to the edge:
image

Adding the breakpoint at xs adds some padding to the page header:
image

Since the content is already padded at anything larger than xs, it makes more sense for that to be the breakpoint.

Copy link
Contributor

github-actions bot commented May 7, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3380.centralus.5.azurestaticapps.net

@jakebailey jakebailey merged commit 98ce242 into microsoft:v2 May 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-preview Enables automatic deployments to preview environments on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mobile friendly website for Handbook and Documentation
2 participants