From 0d2371be545ca5ee094f559197b38ba7f228f819 Mon Sep 17 00:00:00 2001 From: William L Date: Wed, 10 Jun 2020 15:24:04 -0700 Subject: [PATCH 1/4] Format README --- README.md | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c6ba4ae..1de0b2b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # vue-skip-to -It helps people who only use the keyboard to jump to what matters most + +> Helps people who only use the keyboard to jump to what matters most + +## About The population grows very fast nowadays and with that the number of visually impaired increases as well. Did you know that we have over 350 million visually impaired people in the world? @@ -7,23 +10,28 @@ However, we are responsible for doing our utmost to make our applications usable "Skip to content" or "skip to a section" of your site is one of the most common accessibility techniques today, but not as used as it should be. -In addition to being a technique recommended by WCAG 2.0, that's where this component was inspired. -https://www.w3.org/TR/WCAG20-TECHS/G1.html -https://www.w3.org/TR/WCAG20-TECHS/G124.html +This pattern is detailed in the Techniques for WCAG 2.0 in notes [G1](https://www.w3.org/TR/WCAG20-TECHS/G1.html) and [G124](https://www.w3.org/TR/WCAG20-TECHS/G124.html), and also served as the inspiration for creating this component. ## Install -#### NPM + +### NPM + ```shell npm install -S @vue-a11y/skip-to ``` -#### Yarn +### Yarn + ```shell yarn add @vue-a11y/skip-to ``` ## How to use + +## Vue SFC + In your `main.js` + ```javascript import Vue from 'vue' import VueSkipTo from '@vue-a11y/skip-to' @@ -36,6 +44,7 @@ new Vue({ ``` In your `App.vue` + ```vue + ``` -## Using with HTML files +### In HTML files + ```html @@ -86,22 +97,24 @@ export default { ``` -## Check live demo -https://vue-skip-to.surge.sh +## Live demo +[https://vue-skip-to.surge.sh](https://vue-skip-to.surge.sh) ## Props + Prop | Data Type | required | Description | Default --------------- | ---------- | --------- | ---------------------- | ------------- `to` | String | false | Set destination ID | #main `text` | String | false | Text content of link | Skip to main content ## Custom style -You can style the link through the selector `.vue-skip-to` + +You can style the link through the selector `.vue-skip-to`. ## Feature -Inspired by this article, to know more, access the link: -http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ + +Inspired by [this article](http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/). - This component working in all modern browsers and IE9; - Ensures that the target element receives focus, even if it is not a tag that naturally receives focus as the tag `input` and `a`. In this case, the `div` are also given the focus and the `tabindex` attribute with the value of `-1`; @@ -110,18 +123,20 @@ http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ ## Run the tests ```shell -git clone https://github.com/vue-a11y/vue-skip-to.git +git clone https://github.com/vue-a11y/vue-skip-to.git npm install npm run dev npm run test:e2e ``` Or run Cypress on interactive mode + ```shell npm run test:e2e:open ``` ## Contributing + - From typos in documentation to coding new features; - Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found; - Fork repository, make changes and send a pull request; From bbaf97f39726e3c9cbf4af3edd1fbcf1fb97a008 Mon Sep 17 00:00:00 2001 From: William L Date: Wed, 10 Jun 2020 15:59:00 -0700 Subject: [PATCH 2/4] Note skip-link list usage in README --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1de0b2b..ab7b0a2 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,11 @@ yarn add @vue-a11y/skip-to ## How to use -## Vue SFC - -In your `main.js` +### Vue SFC ```javascript +// main.js + import Vue from 'vue' import VueSkipTo from '@vue-a11y/skip-to' @@ -43,16 +43,17 @@ new Vue({ }) ``` -In your `App.vue` - ```vue +// App.vue