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

Increase login links touch area on small screens #4680

Merged
merged 6 commits into from
Sep 15, 2021
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented Aug 27, 2021

Objectives

  • Make it easier to click/touch the "Sign in", "Register", "My content", "My account" and "Sign out" links on small screens
  • Make it easier to read menu items spanning over several lines
  • Make it obvious on small screens that "my content" links are not part of the site navigation

Visual Changes

Before these changes

On small screens there's barely any vertical space between the "My content" and "My account links"

The space between the lines of a navigation element is the same as the space between elements

The space between the lines of a menu element is very small

After these changes

On small screens there's plenty of vertical space between the "My content" and "My account links"

The space between the lines of a navigation element is smaller than the space between elements

The space between the lines of a menu element is the standard space between lines used everywhere else

@javierm javierm self-assigned this Aug 27, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Aug 27, 2021
@javierm javierm force-pushed the small_menu_links branch 2 times, most recently from 8c8092a to fea3fe2 Compare September 1, 2021 21:18
When, on small screens, a navigation element had a very long text
causing it to span over multiple lines, the space between each line was
the same as the space between elements. This made it hard to see where
elements started and ended.

Using a padding to separate the contents of one element and the contents
of the next one solves the issue.
In commit 55c3c79 we updated the admin layout header to use
`class="dropdown menu" data-dropdown-menu` instead of `class="menu"
data-responsive-menu="medium-dropdown"`.

Then, in commit dcec003, we updated the public layout header to use
`class="menu" data-responsive-menu="medium-dropdown"` instead of
`class="dropdown menu" data-dropdown-menu`.

Now we're applying the same classes to both, hoping we can get some
consistent styles.

I'm choosing to keep the ones in the public layout because using it I
had less problems when trying to improve the styles of this navigation.
Having the logo inside a list of one item wasn't needed and its classes
conflicted with other elements with the `.menu` class.
Some of these styles were redundant and so we can remove them.
On small screens, the "Sign in", "Register", "My content", "My account"
and "Sign out" links didn't have much padding nor space between them,
and it was easy to accidentally click the wrong link.

This change also positively affects the menu on medium and large
screens. When one of the options (like "SDG content") had a text
spanning over two lines (like it happens in Swedish), there was barely
any space between those two lines. So we're using `line-height: inherit`
instead and adjusting the padding accordingly.
@javierm javierm force-pushed the small_menu_links branch 2 times, most recently from ce123f3 to e2d6809 Compare September 12, 2021 12:20
The "Sign in" or "My account" links and the main navigation are
different elements, and they're in different places on medium and large
screens. Now we're also separating them on small screens.

Since the `.vertical` class in the menu added quite a few styles and it
was difficult to overwrite them, we're simply removing this class from
this element. This way we're also removing the huge space between the
menu button and the first element of the navigation.
@taitus taitus self-assigned this Sep 15, 2021
Consul Democracy automation moved this from Reviewing to Testing Sep 15, 2021
@javierm javierm merged commit 7254ca3 into master Sep 15, 2021
@javierm javierm deleted the small_menu_links branch September 15, 2021 15:30
Consul Democracy automation moved this from Testing to Release 1.4.0 Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants