Skip to content

no list accordions#1137

Closed
joshbruce wants to merge 6 commits into
uswds:18f-pages-stagingfrom
joshbruce:accordion-no-list
Closed

no list accordions#1137
joshbruce wants to merge 6 commits into
uswds:18f-pages-stagingfrom
joshbruce:accordion-no-list

Conversation

@joshbruce

Copy link
Copy Markdown

Fixes #1136

I am not sure what the conversation around placing each accordion
within a list item was; however, it feels less than semantic to have a
list item containing a button and a div…imagine a text document with a
list item containing an entire chapter of a book, for example.

I’m also curious if a more suitable tag (say, section) would be more
proper, given the specification of a div and section:

http://www.w3.org/TR/html5/grouping-content.html#the-div-element - The
div element has no special meaning at all. … Authors are strongly
encouraged to view the div element as an element of last resort, for
when no other element is suitable.

http://www.w3.org/TR/html5/sections.html#the-section-element - The
section element represents a generic section of a document or
application.

Changing to a section tag could get us toward a no JavaScript solution
to the accordions (#1122 and #1121) - basically, add the buttons and
collapse the content if JS is present.

Could result in “flashing” content though prior to JS kicking in.

JBruce and others added 6 commits April 11, 2016 20:29
Fixes #1136

I am not sure what the conversation around placing each accordion
within a list item was; however, it feels less than semantic to have a
list item containing a button and a div…imagine a text document with a
list item containing an entire chapter of a book, for example.

I’m also curious if a more suitable tag (say, section) would be more
proper, given the specification of a div and section:

http://www.w3.org/TR/html5/grouping-content.html#the-div-element - The
div element has no special meaning at all. … Authors are strongly
encouraged to view the div element as an element of last resort, for
when no other element is suitable.

http://www.w3.org/TR/html5/sections.html#the-section-element - The
section element represents a generic section of a document or
application.

Changing to a section tag could get us toward a no JavaScript solution
to the accordions (#1122 and #1121) - basically, add the buttons and
collapse the content if JS is present.

Could result in “flashing” content though prior to JS kicking in.
@maya

maya commented May 4, 2016

Copy link
Copy Markdown
Contributor

Hi @joshbruce, we'll have to take a deeper look into the semantics of the accordion. Thanks for bringing it up. The team is currently at an offsite, so apologies for the delay.

cc @nickbristow

@msecret

msecret commented May 6, 2016

Copy link
Copy Markdown
Contributor

@joshbruce, I commented on #1136, I'm not sure I agree with removing the list aspect from the accordions.

@joshbruce joshbruce mentioned this pull request May 6, 2016
@@ -11,21 +11,6 @@ $accordion-border: 3px solid $color-gray-lightest;
margin-top: 1rem;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So unfortunately the files in docs/ are not actually the source files and shouldn't be hand edited. The files in src are where the scss files should be edited which will then be copied into docs.

I'm sorry for this confusion, it was done to limit complications with the Jekyll docs site and we're actually working on fixing it right now. In the meantime, it would help us if you could move your code changes in this file to src/stylesheets/components/_accordions.scss and then run the build process with npm run build or the more specific gulp tasks.

Let me know if you'd like some help with this. You've been a great contributor so I'd be happy to get these files into the correct form.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @msecret!

I thought that's where we were going with gulp.

Would the gulpfile.js found here help inform the fix you are looking to make with the gulp build? (https://github.com/BrianGilmanGSA/sam-web-design-standards)

Right now I cannot run a gulp build (see #1148) - I can only do $ ./go serve to confirm the changes, which doesn't update the /docs. If you could help me out on that score, I would be more than happy to make changes and resubmit along with using the /src directory for future PRs.

Thanks again.

@joshbruce joshbruce May 9, 2016

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, meant the website.js file: https://github.com/BrianGilmanGSA/sam-web-design-standards/blob/gh-pages/config/gulp/website.js

Note: There are changes to the other /config/gulp files as well to separate out the /src from the /scss for the Jekyll build.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure let's work through it.

What happens when you run gulp website:serve? Is there an error you could show me?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to clone directly from the 18f repo instead of my fork - just to make sure.

  1. Cloned 18f/web-desing-standards
  2. $ cd ~/path/to/repo
  3. Completed
  4. Ran bundle update
  5. Completed
  6. Ran npm update
  7. Completed
  8. Ran $ gulp website:serve
  9. Halted with: jekyll 3.1.3 | Error: File to import not found or unreadable: lib/bourbon. Load path: /path/to/repo/docs/_scss on line 3

It appears /src/stylesheets/lib no longer exists: https://github.com/18F/web-design-standards/tree/18f-pages-staging/src/stylesheets

On the initial clone, /docs/_scss/lib does exist: https://github.com/18F/web-design-standards/tree/18f-pages-staging/docs/_scss

When $ gulp website:serve removes /docs/_scss the /docs/_scss/lib directory is removed and not replaced.

Let me know if you experience something different - or, of course, if I'm doing this incorrectly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fascinating.

Still needed the $ bundle update - just in case that shouldn't be necessary.

Can you point me to why install versus update makes the difference?

Reading the Terminal didn't seem much different.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshbruce first off, did that solution work for you at all?

Based on the documentation on npm, and what I've read, there doesn't seem to be a large difference(http://stackoverflow.com/questions/12478679/npm-install-vs-update-whats-the-difference), I gave you that command just to ensure we're both doing the same thing to make debugging a little easier.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msecret - Sorry, should have been more explicit.

Yes. The build completed.

I'm not sure what difference there was, but it was enough for /src/stylesheets/lib To appear. Not sure why though, as I thought install and update only effected the /node_modules directory.

@joshbruce joshbruce May 9, 2016

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msecret - Just a quick follow up - I'm a curious soul - sorry for blowing up your inbox. Wanted to show some screenshots to isolate when it happens.

Before $ npm install

screen shot 2016-05-09 at 5 03 29 pm

After $ npm install

screen shot 2016-05-09 at 5 05 04 pm

The point at which the /src/stylesheets/lib directory appeared.

screen shot 2016-05-09 at 5 05 18 pm

Looks like $ npm update does not run the $ gulp copy-vendor-sass - from the npm prestart (??), which makes sense. To test that hypothesis - I did the following.

  1. $ bundle update - to avoid the kramdown error (must be done prior to $ npm start).
  2. $ npm update
  3. $ npm start

It worked. Which makes sense as calling $ gulp website:serve does not appear to call $ gulp copy-vendor-sass. If the goal is to not call gulp directly - then it works as expected.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah @joshbruce I figured it out:

In package.json we have a prepublish script that executes certain commands after npm install (which doesn't make much sense). I guess those have to be run before website:serve.

I'll keep this in mind when working on improving the dev workflow this week.

@ducklet

ducklet commented May 10, 2016

Copy link
Copy Markdown

@joshbruce I created #1153 to restore the functionality of aria-hidden, which should remain in place. I believe it makes sense to add the display: none !important rule to the <div> when the <button>'s aria-expanded state is "false", but I don't know javascript. When you re-open/restore this PR would you please be so kind as to add the appropriate code? I believe this would be the last step in resolving #1120.

Thanks, and of course kit with any comments/questions, I hope I've thought of everything here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants