Skip to content

Commit

Permalink
Publish Sa11y 3.0 (ryersondmp#49)
Browse files Browse the repository at this point in the history
View [Sa11y 3.0 Release Notes](https://github.com/ryersondmp/sa11y/releases/tag/3.0.0)

## Acknowledgements 
Thanks to [@thibaudcolas(https://github.com/thibaudcolas), [@albinazs](https://github.com/albinazs), and [@brianteeman](https://github.com/brianteeman) for offering their guidance and feedback around  RTL styles & web components. 

### German translations
Co-authored-by: Tim <[email protected]>, Thomas Skerbis <[email protected]> and @ansichtsache <[email protected]>, and [@skerbis](https://github.com/skerbis)
  • Loading branch information
adamchaboryk authored May 3, 2023
1 parent 93bd5c9 commit 0c14e0c
Show file tree
Hide file tree
Showing 146 changed files with 61,959 additions and 37,581 deletions.
17 changes: 9 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"extends": "airbnb-base",
"env": {
"browser": true
"browser": true
},
"rules": {
"max-len": "off",
"class-methods-use-this": "off",
"import/prefer-default-export": "off",
"import/extensions": "off",
"class-methods-use-this": "off",
"import/prefer-default-export": "off",
"import/extensions": "off",
"max-classes-per-file": "off",
"no-plusplus": [
"error",
"object-curly-newline": "off",
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
]
]
}
}
}
9 changes: 9 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"rules": {
"declaration-bang-space-before": "always",
"declaration-bang-space-after": "never",
"declaration-property-value-allowed-list": {
"clear": ["both", "none"],
"float": ["inline-start", "inline-end", "none", "unset"],
"text-align": ["start", "end", "center"]
},
"property-disallowed-list": [
"/left/",
"/right/"
],
"color-named": "never",
"declaration-block-no-duplicate-properties": true,
"block-no-empty": true,
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ Want to help make Sa11y better? There are many ways you can contribute.
- Report a bug.
- Submit a bug fix.
- Propose new features or rulesets.
- Discuss existing rulesets.
- Discuss existing rulesets.
- Help translate into other languages.
- Provide feedback or a testimonial!

## How to report bugs
Report bugs by creating a new [issue.](https://github.com/ryersondmp/sa11y/issues) If you do not have a GitHub account, feel free to email [adam.chaboryk@ryerson.ca](mailto:adam.chaboryk@ryerson.ca)
Report bugs by creating a new [issue.](https://github.com/ryersondmp/sa11y/issues) If you do not have a GitHub account, feel free to email [adam.chaboryk@torontomu.ca](mailto:adam.chaboryk@torontomu.ca)

When creating an issue, try to:
When creating an issue, try to:
- Provide a detailed summary of the issue and screenshot if possible.
- If possible, provide the URL where Sa11y didn't work properly.
- If possible, provide the URL where Sa11y didn't work properly.
- Provide specific steps to reproduce the issue.

## How to propose new rulesets or discuss an existing one
Some of Sa11y's rulesets are based on best practices or are inspired by commonly seen issues that were created by content authors at Ryerson University. Therefore some rulesets may contain logic that uses arbitrary variables that are not based on normative WCAG success criteria or failures. For example, if a blockquote contains less than 25 characters it will be flagged as an error. This is not a WCAG failure. However, if a content author is using a blockquote as a section heading for visual aesthetics, then it does become a failure of 1.3.1: Info and Relationships. Using an arbitrary number like 25, we assume that it is a short section heading and not a real quote.
Some of Sa11y's rulesets are based on best practices or are inspired by commonly seen issues that were created by content authors at Ryerson University. Therefore some rulesets may contain logic that uses arbitrary variables that are not based on normative WCAG success criteria or failures. For example, if a blockquote contains less than 25 characters it will be flagged as an error. This is not a WCAG failure. However, if a content author is using a blockquote as a section heading for visual aesthetics, then it does become a failure of 1.3.1: Info and Relationships. Using an arbitrary number like 25, we assume that it is a short section heading and not a real quote.

If you would like to discuss an existing ruleset, please create a new [issue.](https://github.com/ryersondmp/sa11y/issues) Provide any references or sources if you are proposing a new ruleset or would like to change an existing one.

## Translations
Translations may either be contributed back to the repository with a pull request, or translated files can be returned to: [adam.chaboryk@ryerson.ca](mailto:adam.chaboryk)
Translations may either be contributed back to the repository with a pull request, or translated files can be returned to: [adam.chaboryk@torontomu.ca](mailto:adam.chaboryk@torontomu.ca)

## How to contribute code
There's a couple of ways you can contribute code.
Expand All @@ -31,7 +31,7 @@ There's a couple of ways you can contribute code.
If it's a simple code fix or ruleset: consider creating a new [issue.](https://github.com/ryersondmp/sa11y/issues) Please fork the repo and test your code before submitting it.

### Option 2: Pull request
Pull requests should be used for “heavy-duty” changes to the code base. Although before you invest time and effort, please create an [issue](https://github.com/ryersondmp/sa11y/issues) discussing your idea. Once approved, feel free to go ahead and fork the repo.
Pull requests should be used for “heavy-duty” changes to the code base. Although before you invest time and effort, please create an [issue](https://github.com/ryersondmp/sa11y/issues) discussing your idea. Once approved, feel free to go ahead and fork the repo.

1. Fork the repo and create your branch from `master`.
2. Add comments to your code.
Expand Down
66 changes: 20 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,104 +11,78 @@
* [WordPress plugin development repo](https://github.com/ryersondmp/sa11y-wp) 🛠
* [Acknowledgements](https://sa11y.netlify.app/acknowledgements/) 👤

## Features
- Over 50 checks that encourage quality accessibility.
- Checks for issues regarding images, headings, links, form labels, and more.
- Toggleable/optional checks: readability analysis, contrast checking, and colour filters.
- **Automatic:** checks content on page load.
- **Customizable:** JSON-like props to fine tune the experience for content authors.
- **Focus on the issues:** Turn off or hide irrelevant checks.
- **Scalable:** Check every page for accessibility.
- Support for checking items within web components/shadow DOM and headless checks.
- Fully encapsulated user interface with dark mode.
- Offered in various [languages.](https://github.com/ryersondmp/sa11y/tree/master/src/js/lang)

## Contributing
Want to help translate or improve Sa11y? Consider [contributing!](https://github.com/ryersondmp/sa11y/blob/master/CONTRIBUTING.md) Translations may either be contributed back to the repository with a pull request, or translated files can be returned to: [adam.chaboryk@ryerson.ca](mailto:adam.chaboryk)
Want to help translate or improve Sa11y? Consider [contributing!](https://github.com/ryersondmp/sa11y/blob/master/CONTRIBUTING.md) Translations may either be contributed back to the repository with a pull request, or translated files can be returned to: [adam.chaboryk@torontomu.ca](mailto:adam.chaboryk@torontomu.ca)

## Contact
Have a question or any feedback? Email: [adam.chaboryk@ryerson.ca](mailto:adam.chaboryk)
Have a question or any feedback? Email: [adam.chaboryk@torontomu.ca](mailto:adam.chaboryk@torontomu.ca)

<hr>

## Install
Sa11y is a framework-agnostic JavaScript plugin. It's made with vanilla JavaScript and CSS, and its only dependency is Tippy.js - a highly customizable tooltip library that features a positioning system.

To install on your website, insert Sa11y right before the closing </body> tag. Sa11y consists of four files:
To install on your website, insert Sa11y right before the closing `</body>` tag. Sa11y consists of three files:

- **sa11y.css** - The main stylesheet. Should be included in the <head> of the document (if possible).
- **sa11y.css** - The main stylesheet. Should be included in the `<head>` of the document (if possible).
- **lang/en.js** - All text strings and tooltip messages. View [supported languages.](https://sa11y.netlify.app/developers/#languages)
- **sa11y.js** - Contains all logic.
- **(Optional) sa11y-custom-checks.js** - Any custom checks created by you.

### NPM
`npm i sa11y`

### Example installation (modules)
````html
<!-- Stylesheet -->
<link rel="stylesheet" href="css/sa11y.css"/>
<link rel="stylesheet" href="css/sa11y.min.css"/>

<!-- JavaScript -->
<script type="module">
import { Sa11y, Lang } from '../assets/js/sa11y.esm.js';
import Sa11yLangEn from '../assets/js/lang/en.js';
import CustomChecks from '../assets/js/sa11y-custom-checks.esm.js'; // Optional
// Set translations
Lang.addI18n(Sa11yLangEn.strings);
// Instantiate
const sa11y = new Sa11y({
customChecks: new CustomChecks, // Optional
checkRoot: "body",
readabilityRoot: "main",
// Customize with props.
});
</script>
````

### Example installation (regular script)
````html
<!-- Stylesheet -->
<link rel="stylesheet" href="css/sa11y.css"/>
<link rel="stylesheet" href="css/sa11y.min.css"/>

<!-- JavaScript -->
<script src="/dist/js/sa11y.umd.min.js"></script>
<script src="/dist/js/lang/en.umd.js"></script>

<!-- Optional: Custom checks -->
<script src="/dist/js/sa11y-custom-checks.umd.min.js"></script>

<!-- Instantiate -->
<script>
Sa11y.Lang.addI18n(Sa11yLangEn.strings);
const sa11y = new Sa11y.Sa11y({
customChecks: new CustomChecks, // Optional
checkRoot: "body",
readabilityRoot: "main",
// Customize with props.
});
</script>
````

### Example installation (Typescript)
````typescript
// src/your-script.ts

import { Sa11y, Lang, LangEn } from "sa11y";
import CustomChecks from "./your-custom-checks";
import "sa11y/dist/css/sa11y.css";

Lang.addI18n(LangEn.strings);
const sa11y = new Sa11y({
customChecks: new CustomChecks, // Optional
checkRoot: "body",
readabilityRoot: "main",
});

// -------------------------------------------------------------

// src/your-custom-checks.ts
import { Sa11yCustomChecks } from "sa11y";

export default class CustomChecks extends Sa11yCustomChecks {
check() {
/**
* Add custom checks here. For more details, see:
* - ./src/js/sa11y-custom-checks.js
* - https://sa11y.netlify.app/developers/custom-checks/
*/
}
}
````

### CDN
Please visit [developer documentation](https://sa11y.netlify.app/developers/) for CDN installation instructions.

Expand Down
1 change: 1 addition & 0 deletions bookmarklet/de.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 1 addition & 35 deletions bookmarklet/fr.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 1 addition & 35 deletions bookmarklet/pl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 1 addition & 35 deletions bookmarklet/sa11y-en.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0c14e0c

Please sign in to comment.