Commit Graph

11 Commits

Author SHA1 Message Date
Javi Martín
125106f9c0 Simplify code to have an off-canvas menu
While Foundations's off-canvas menu allows us to forget about writing
CSS, it also leads to complicated HTML.

Ideally Foundation would provide an easy way to simplify what we're
doing, but I haven't found anything in the documentation.

We could simplify the HTML a bit more if we used a CSS grid layout
instead of a flex one, but old browsers have better support for the
latter.

Note we're using `breakpoint(medium)` so we can group the CSS for small
screens and follow SCSS-Lint rules at the same time.

Also note behavior of the main area when the menu appears on small
screens is slightly different: it doesn't move the main content to the
right. I've done it this way so we don't have any overflow issues,
unlike the previous version.

There's a small issue using a label and a checkbox to enable/disable the
menu: sighted keyboard users with a small screen might not be able to
enable the menu. So we're adding the `:focus-within` pseudoclass so the
menu can be normally navigated using the keyboard. Even if old browsers
don't support this pseudoclass, we believe the probability of a sighted
user using a small screen, navigating with the keyboard and using an old
browser is really low, particularly in the admin area.

We're also adding the `aria-hidden` attribute on the label, since the
menu is never hidden for screen readers and so having a control to show
it could be confusing. Since the label is not focusable, we're complying
with the fourth ARIA rule:

> Do not use role="presentation" or aria-hidden="true" on a focusable
> element .
>
> Using either of these on a focusable element will result in some users
> focusing on 'nothing'.
2020-09-21 15:14:20 +02:00
decabeza
acc7cf65e3 Replace single quotes to double quotes on scss files 2019-02-11 17:42:58 +01:00
decabeza
e3b92f1c0c Adds foundation assets 2018-06-06 12:00:39 +02:00
decabeza
639f24e316 adds foundation orbit components and customise them 2017-10-04 10:12:54 +02:00
decabeza
7d6b8e49fe moves foundation settings to consul settings scss 2017-07-24 17:13:41 +02:00
Alberto
868ed78488 Merge pull request #1348 from aspgems/custom_settings_scss
Add custom setting for foundation variables.
2017-01-16 17:58:05 +01:00
Juanma
e418937d42 Add custom setting for foundation variables. 2017-01-13 11:49:23 +01:00
Juanma
f088e89068 Fixes bug in menu icon in mobile browsers. 2016-12-20 07:34:56 +01:00
Alberto Garcia Cabeza
d1f34c8288 Removes unused image and scss 2016-05-18 12:47:24 +02:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
rgarcia
155a96d8fc configures foundation #2 2015-07-16 17:03:05 +02:00