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

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

Open
jongund opened this issue Sep 19, 2023 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@jongund
Copy link
Contributor

jongund commented Sep 19, 2023

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
Copy link
Contributor

@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
Copy link
Contributor

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 mcking65 changed the title Update skipto.js to use data-skipto attribute for configuration Update build process to use data-skipto attribute to configure skipto.js Sep 21, 2023
@mcking65 mcking65 added the enhancement New feature or request label Oct 3, 2023
@mcking65
Copy link
Contributor

mcking65 commented Oct 3, 2023

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
Copy link
Contributor

@mcking65 @jongund the support for this has now been included in #292, which has been reviewed and ready to merge.

w3c/aria-practices#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.

mcking65 added a commit to w3c/aria-practices that referenced this issue Feb 13, 2024
Updates skipto.js to use version 5.2.1 without APG specific modifications.

In lieu of modifying the script, the script import now specifies parameters for the desired behaviors.

This required changing the script import on every page to include the following data attribute:
```
  <script data-skipto="colortheme: aria; displayoption: popup" src="../../shared/js/skipto.js"></script>
```
 
This is related to [issue 259](w3c/wai-aria-practices#259) in wai-aria-practices repository.

---------

Co-authored-by: Matt King <a11yThinker@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In production / Completed
Development

No branches or pull requests

3 participants