├── .eslintrc ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── index.js ├── package.json └── test.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | }, 5 | "parserOptions": { 6 | "ecmaVersion": 2018, 7 | "sourceType": "module" 8 | }, 9 | "extends": ["eslint-config-postcss", "prettier"], 10 | "plugins": ["prettier"], 11 | "rules": { 12 | "prettier/prettier": [ 13 | "error", 14 | { 15 | "semi": false, 16 | "singleQuote": true, 17 | "printWidth": 100, 18 | "tabWidth": 2, 19 | "useTabs": false, 20 | "trailingComma": "es5", 21 | "bracketSpacing": true, 22 | "parser": "flow" 23 | } 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /yarn.lock 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - '8' 5 | 6 | cache: 7 | directories: 8 | - node_modules 9 | 10 | before_install: 11 | - npm update 12 | 13 | install: 14 | - npm install 15 | 16 | script: 17 | - npm test 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Oliver Davies 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tailwind CSS Plugin: Skip Link 2 | 3 | ## Overview 4 | 5 | ```sh 6 | # Using npm 7 | npm install --save-dev tailwindcss-skip-link 8 | 9 | # Using yarn 10 | yarn add --dev tailwindcss-skip-link 11 | ``` 12 | 13 | ## Usage 14 | 15 | You can add the plugin to your Tailwind config as follows: 16 | 17 | ```js 18 | plugins: [ 19 | // ... 20 | require('tailwindcss-skip-link')(), 21 | ], 22 | ``` 23 | 24 | Within your HTML, add the skip link straight after the `body` tag along with any other additional classes: 25 | 26 | ```html 27 | Skip to main content 28 | ``` 29 | 30 | Then add the matching ID to skip to on your main content element. 31 | 32 | ```html 33 |