w3c / wai-aria-practices

WAI Website Resource for aria-practices guidelines
https://aria-practices.netlify.app/aria/apg/
15 stars 14 forks source link

Update build process to use data-skipto attribute to configure skipto.js #259

Open jongund opened 9 months ago

jongund commented 9 months ago

I would like to update skipto.js to use the standard distribution. Right now I created a customized version of skipto.js for the APG that sets the default colorTheme to use the aria option and for displayOption the 'popup` option.

The data-skipto attribute can be put on thescript element referencing skipto.js, for example:

  <script data-skipto="colorTheme:aria; displayOption:popup; containerElement:div" src="../../shared/js/skipto.js"></script>

I have created a PR 2807 in the aria-practices repository for the current production version of skipto.js.

It can also be downloaded or referenced from: https://github.com/skipto-landmarks-headings/page-script-5/tree/main/dist

mcking65 commented 9 months ago

@jongund @howard-e

Yesterday I misspoke. Except for patterns.html and practices.html, which are still not sourced from aria-practices, we can handle this completely from the aria-practices side. Except for those two pages, the script tags are all in the content files.

I pushed a commit to #2807 that updates the script tags.

So, as far as wai-aria-practices repo build is concerned, I think we only need to address patterns.html and practices.html, which we wouldn't have to do if we had completed w3c/aria-practices#2702. I am tempted to say we need to prioritize 2702 in 4Q.

mcking65 commented 9 months ago

So, after working on w3c/aria-practices#2807 a little more, I found that there are three pages for which we cannot control the presentation of skipto from the aria-practices repo:

  1. content/apg-home.html
  2. content/patterns/patterns.html
  3. content/practices/practices.html

I added the new script tag to the home page file, but it is ignored by the build. It would be nice if we could fix that so that it is not ignored or overridden.

So, I think there are two changes to make to the build process to resolve this issue:

  1. Make it respect/use the script tag that is in content/apg-home.html
  2. Have it add the following attribute to the skipto script element for the patterns and practices pages:
data-skipto="colorTheme:aria; displayOption:popup; containerElement:div"
mcking65 commented 9 months ago

Most of the work for this issue could end up being addressed when we work on w3c/aria-practices#2702. So, I have bumped 2702 to P1 and this down to p2 in the Q4 infra project.

howard-e commented 5 months ago

@mcking65 @jongund the support for this has now been included in https://github.com/w3c/wai-aria-practices/pull/292, which has been reviewed and ready to merge.

https://github.com/w3c/aria-practices/pull/2807 will need to add the script tag to content/patterns/patterns.html and content/practices/practices.html as well, and then be merged in aria-practices, before #292 can be.