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

Header component has visible unusable menu button when CSS fail to load. #775

Closed
2 tasks
NickColley opened this issue Jun 7, 2018 · 2 comments · Fixed by #2727
Closed
2 tasks

Header component has visible unusable menu button when CSS fail to load. #775

NickColley opened this issue Jun 7, 2018 · 2 comments · Fixed by #2727
Assignees
Labels
firebreak0722 From Firebreak in July 2022 header sass / css
Milestone

Comments

@NickColley
Copy link
Contributor

NickColley commented Jun 7, 2018

Not a big deal but might be nice to use the 'hidden' attribute, or a hardcoded 'display: none'.

Screenshot 2021-09-01 at 10 34 39

Done when

  • TBC
  • "Details of breaking change" section below completed to help with writing release notes

Details of breaking change

  • which users are affected: TBC
  • the change that’s been made: TBC
  • changes users will have to make: TBC
  • impact of users not making those changes: TBC
@kr8n3r
Copy link

kr8n3r commented Feb 13, 2019

button is also visible if CSS succeeds and JS fails, reason being #999

this can be remedied with hidden and display: block | inline-block in CSS for all 4 scenarios

  • if css fails, the button should’t be present
  • if js fails and css succeeds, the button shouldn’t be present
  • if js succeeds and css fails, the button shouldn’t be present
  • if both succeed the button should be present

but it requires a move away from using the templates' js-enabled class and having a method for each component to register that it's JS enhanced, say .js-ready or similar.

I don't think attaching a button via js is an option, as it adds extra complexity around when to attach it (only when navigation is present)

@owenatgov
Copy link
Contributor

I'm going to put together a slight alternative to @kr8n3r's comment above based on our current approach on the design system website which itself is based on the approach on gov.uk. In brief, it uses hidden by default on the menu button and the toggle-able navigation list to handle visibility and a match media enhancement to manage changes in screen size, all but removing reliance on CSS for the show/hide feature.

The element visibility to progressive enhancement would look like this:

  • no JS: button not visible, navigation visible
  • JS: button visible, navigation initially not visible but toggle-able, button not visible and menu visible on desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firebreak0722 From Firebreak in July 2022 header sass / css
Projects
Development

Successfully merging a pull request may close this issue.

9 participants