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

docs: fix styling for buttons on mobile #42

Merged

Conversation

dalenguyen
Copy link
Contributor

@dalenguyen dalenguyen commented Aug 18, 2022

References

New Behaviour

image

@dalenguyen
Copy link
Contributor Author

@brandonroberts @LayZeeDK I'm utilizing margin-bottom--md (1rem) from infima & flex-wrap to push the button down on mobile devices. Please let me know if this approach works.

@LayZeeDK
Copy link
Contributor

Good solution, @dalenguyen.

I wonder how it looks if we make those CTA button links full width on small screens 🤔

@dalenguyen
Copy link
Contributor Author

@LayZeeDK I can target the a tag on smaller screens and make the button full with this

@media screen and (max-width: 562px) { 
  .buttons a {
    flex: 1;
    display: flex;
    justify-content: center;
  }
}

Then on a smaller screen, it will look like this

image

@LayZeeDK
Copy link
Contributor

LayZeeDK commented Aug 18, 2022

Infima/Docusaurus uses a breakpoint, I believe it is 996px width.

@LayZeeDK
Copy link
Contributor

Visually it looks great though!

@brandonroberts
Copy link
Member

I like the full width buttons also!

@dalenguyen
Copy link
Contributor Author

dalenguyen commented Aug 19, 2022

@LayZeeDK I saw that they implement 576px & 996px as breakpoints on their styling. Using 576px makes more sense since having full with buttons on top of each other at 996px is a bit much. What do you think?

image

@LayZeeDK
Copy link
Contributor

Makes sense!

@LayZeeDK
Copy link
Contributor

Add the full width style to the home page and we're good to go in my opinion 😊

@dalenguyen
Copy link
Contributor Author

Cool. Just applied full width to buttons on mobile :D

@@ -20,6 +20,16 @@
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 1rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Great solution!

Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Use the Infima spacing variable instead of hard-coding 1rem.

Suggested change
gap: 1rem;
gap: var(--ifm-global-spacing);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, great catch :D

Copy link
Member

@brandonroberts brandonroberts left a comment

Choose a reason for hiding this comment

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

LGTM

@brandonroberts brandonroberts merged commit 9366104 into analogjs:main Aug 19, 2022
@brandonroberts
Copy link
Member

Thanks Dale! @allcontributors Please add @dalenguyen for css

@allcontributors
Copy link
Contributor

@brandonroberts

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

@brandonroberts
Copy link
Member

Ok lol. @allcontributors Please add @dalenguyen for design

@allcontributors
Copy link
Contributor

@brandonroberts

I've put up a pull request to add @dalenguyen! 🎉

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.

[DOCS] fix buttons styling on mobile
3 participants