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

Reduce button padding on mobile viewport #55

Closed
JohnPixle opened this issue Jul 12, 2023 · 8 comments
Closed

Reduce button padding on mobile viewport #55

JohnPixle opened this issue Jul 12, 2023 · 8 comments
Assignees
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project

Comments

@JohnPixle
Copy link
Contributor

Currently the buttons in Neve FSE have a generous padding (16px 40px). However, in Mobile this results in some issues with button not staying inline.

Screenshot 2023-07-12 at 12 25 27 PM

I was wondering, if for mobile viewport we can have the buttons set to 16px padding (all sides).
Please note that this should also apply for the is-style-outline button

Hopefully we will be able to have the buttons inline on mobile.

Screenshot 2023-07-12 at 12 28 55 PM

@HardeepAsrani Let me know your thoughts, and happy to help with clarifications and more info!
Looping-in @mghenciu for awareness.

@HardeepAsrani HardeepAsrani added the enhancement Request to improve or optimize an existing feature or functionality in the project label Jul 12, 2023
@HardeepAsrani
Copy link
Member

@JohnPixle I don't mind really, it's a purely design decision so I'd leave it to you and how you want to proceed with it. 😄

@JohnPixle
Copy link
Contributor Author

@HardeepAsrani Thanks! I asked because we need some input/help on how / where these mobile values are defined 🙈

To summarise, for mobile viewport we need the buttons set to 16px padding (all sides).
And this should also apply for the is-style-outline buttons.

We are sure we want to make the change, but not sure where to add the CSS. For example, I see that the style for outline button is defined in the theme files (screenshot).

Screenshot 2023-07-18 at 11 27 00 AM

Can you point us where to add the mobile values?
Thanks in advance!

@HardeepAsrani
Copy link
Member

@JohnPixle It's added here:

body .wp-block-button .wp-block-button__link.is-style-outline {

You can use SASS to have a @media selector.

@JohnPixle
Copy link
Contributor Author

JohnPixle commented Jul 19, 2023

You can use SASS to have a @media selector.

@HardeepAsrani Can you explain this in Greek for me please, or provide an example snippet? 😄

@HardeepAsrani
Copy link
Member

@JohnPixle My bad. 😄 Here's an example of how Bogdan is doing this in another file:

@custom-media --tablet (max-width: 769px);
@custom-media --desktop (max-width: 1200px);
.neve-fse-welcome-notice {
position: relative;
padding-bottom: 0;
.notice-content {
display: flex;
width: 100%;
gap: 20px;
@media (--desktop) {
flex-direction: column-reverse;
text-align: center;
gap: 0;
}
}

This should also help: https://sass-lang.com/documentation/at-rules/css/

@mghenciu
Copy link
Contributor

I've made some changes in this PR, @JohnPixle , and used 16px 20px, which should be fine even for smaller Mobile Devices. Let me know if this looks and works as expected.


@HardeepAsrani , I've tried using the DRY principle in CSS, not sure if I managed to achieve perfection :)

@JohnPixle
Copy link
Contributor Author

Thanks @mghenciu looking good!

@mghenciu
Copy link
Contributor

I'll move this to testing, since Bogdan and John reviewed the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project
Projects
None yet
Development

No branches or pull requests

4 participants