Skip to content

Implement new accordion design for FAQ page #985

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

Merged
merged 24 commits into from
Dec 21, 2020
Merged

Implement new accordion design for FAQ page #985

merged 24 commits into from
Dec 21, 2020

Conversation

carolstran
Copy link
Member

@carolstran carolstran commented Dec 5, 2020

💓 This PR is part of Google Season of Docs 💓

With the introduction of more questions and new sections in #982, the current format doesn't work and it's difficult to use. That's why this PR introduces a new design where all of the questions are listed by section and the answers are revealed on click or keypress.

🔗 Preview: https://graphql-faq-preview.netlify.app/faq/
⚠️ All of the content is the same as in #982, this PR is purely code/design changes.
🥪 Yes the commits will be squashed.

Here's an overview of the functionality:

  • Answers revealed under question on click or keypress.
  • Relative URL to the specific question available on click or keypress.
  • When someone shares a link to a specific question, the page will auto-scroll to that question and the answer will be opened automatically.
  • Small animation on the + icon when revealing question.

Known issues:

  • No transition on the answer text when revealed.
  • Screen reader UX a bit repetitive.

Current design:

Screenshot 2020-12-09 at 02 38 03

@carolstran carolstran added 🎨 Design 🚧 In progress 💬 FAQ Related to the FAQ project for Google Season of Docs. labels Dec 5, 2020
@carolstran carolstran self-assigned this Dec 5, 2020
@carolstran carolstran marked this pull request as ready for review December 8, 2020 21:52
@carolstran carolstran changed the title WIP: Implement new accordion design for FAQ page Implement new accordion design for FAQ page Dec 8, 2020
@mikeesto
Copy link
Contributor

mikeesto commented Dec 9, 2020

Nice work @carolstran! Is your screenshot from Safari? On Chrome (Windows) there's a black focus outline and also a stray black pixel (see to the left of the "W" in Why):

windows

Just wanted to let you know in case you weren't aware. By no means a blocker, I think the focus outline is actually useful for accessibility(?) although it looks a little out of place.

@carolstran
Copy link
Member Author

Hey @mikeesto, thanks for taking a look ☺️ The screenshot above is from Firefox and below is how it looks on my machine with the various browsers... but I'm also on Mac... 🤔

As for the design of the focus outline, I definitely want to make sure it's prominent to aid keyboard navigation. I agree though that the blue (or in your view, black) looks a bit out of place - although we do have dark headers on the homepage and Code page so maybe that's an option. AFAIK we don't have any set styles for the focus outlines so it uses whatever is native to the browser.

I'm not a designer so if anyone has strong design opinions let me know 👩🏼‍🎨 ✨

Chrome:
Screenshot 2020-12-09 at 19 11 16

Firefox:
Screenshot 2020-12-09 at 19 09 04

Safari:
Screenshot 2020-12-09 at 19 13 25

❓ Also if we have any rules for which browsers/versions the site should support... someone let me know because that can also go in the contributing guidelines.

@orta
Copy link
Member

orta commented Dec 9, 2020

Re: Browsers, I'd aim for the big 4: Chrome/Edge, Firefox, Safari and Safari on mobile

Re: selection outline - that's generally how I leave it also ( we have the same behavior in the sidebar on https://www.typescriptlang.org/docs/handbook/intro.html ) so it should be fine IMO

Base automatically changed from faq-new-sections to source December 21, 2020 20:54
@carolstran carolstran merged commit faa2d44 into source Dec 21, 2020
@carolstran carolstran deleted the faq-redesign branch December 21, 2020 21:19
Urigo pushed a commit that referenced this pull request Jan 26, 2021
* Initial commit new FAQ design

* Finally something rendering

* Add sidebar

* Jk remove the sidebar again

* Add useAccordion hook

* Move FAQ specific CSS into its own less file

* Fix scrolling issue and keyboard accessibility

* Workaround for gatsby build error

* Remove broken transitions

* Update based on code review in #982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 Design 💬 FAQ Related to the FAQ project for Google Season of Docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants