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

Update slideout to use mobile styles under 600px viewport width #11636

Merged
merged 7 commits into from
Aug 12, 2022

Conversation

gcamacho079
Copy link
Contributor

Description

Resolves DEV-701, DEV-480

Related issues

@linear
Copy link

linear bot commented Jul 19, 2022

DEV-701 Add an address slideout becomes difficult to use at 320px wide

Page Area:

Address tab - address slideout

Issue Description:

On small/zoomed screens, the form takes up less than half of the viewport width, making the form difficult to use

Action:

Ensure that the form is wider on smaller screens or with higher zoom levels

Screenshot/Code Snippet:

Screen Shot 2022-06-07 at 13.11.34.png

Resolves CMS-241

DEV-480 On 320px screens, slug field in element slideout can no longer be seen or edited

Where: Element edit slideout

The slug field value goes to 0px width on small/zoomed screens

The CSS dynamically calculates this width to be 100% minus a set px value, which ends up falling below zero at this screen size. The CSS should be modified to account for smaller screen sizes

#wwnlayoqwj-slug-field > div.input.ltr

Resolves CMS-131

Screen Shot 2022-04-13 at 10.19.56.png

@gcamacho079 gcamacho079 added accessibility 👤 features related to accessibility 🐞 bug labels Jul 19, 2022
@brandonkelly brandonkelly changed the base branch from 4.2 to 4.3 July 27, 2022 22:48
# Conflicts:
#	src/web/assets/admintable/dist/css/app.css
#	src/web/assets/admintable/dist/js/app.js
#	src/web/assets/admintable/dist/js/app.js.map
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
#	src/web/assets/pluginstore/dist/css/app.css.map
@brandonkelly
Copy link
Member

brandonkelly commented Aug 12, 2022

@gcamacho079 Is there a reason you went with 600px for this?

I was thinking it would be good to move Slideout.js::useMobileStyles() to Craft.js so we can use it for other things as well. But it would be good to be consistent about what we consider a “mobile width”.

Looking through the CSS media queries, looks like the smallest viewport size we check for currently is 500px, when determining whether 25/50%-width fields can be displayed side-by-side:

// 2 cols for 500 - 1535px
@media only screen and (min-width: 500px) and (max-width: $minXlUiWidth - 1px) {
&.width-25,
&.width-50 {
width: 50%;
}
}

Do you think we should change that media query to start at 600px, or drop the useMobileStyles() check down to 500px?

@gcamacho079
Copy link
Contributor Author

gcamacho079 commented Aug 12, 2022

Do you think we should change that media query to start at 600px, or drop the useMobileStyles() check down to 500px?

@brandonkelly My rationale here was that at 500px wide, the slideout is only about 250px wide. When I was testing in responsive design mode, 300px seemed like a comfortable minimum width for it.

We could always have the useMobileStyles function use a default parameter of screenWidth = 600, and just override it for the slideout in particular. Or we can stick to 500px across the board 🤔

@brandonkelly brandonkelly merged commit 6d4a802 into 4.3 Aug 12, 2022
@brandonkelly
Copy link
Member

👍🏻 Went with 600px.

@brandonkelly brandonkelly deleted the hotfix/slug-field branch August 12, 2022 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility 👤 features related to accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants