{"id":18751156,"url":"https://github.com/substrate-system/a11y","last_synced_at":"2025-09-01T10:31:12.733Z","repository":{"id":257815712,"uuid":"869804427","full_name":"substrate-system/a11y","owner":"substrate-system","description":"Helpers for accessibility","archived":false,"fork":false,"pushed_at":"2024-11-26T23:17:07.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-26T23:28:34.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/substrate-system.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-08T23:18:47.000Z","updated_at":"2024-11-26T23:17:11.000Z","dependencies_parsed_at":"2024-10-10T22:45:15.307Z","dependency_job_id":null,"html_url":"https://github.com/substrate-system/a11y","commit_stats":null,"previous_names":["substrate-system/a11y"],"tags_count":3,"template":false,"template_full_name":"nichoth/template-ts-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fa11y","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fa11y/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fa11y/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/substrate-system%2Fa11y/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/substrate-system","download_url":"https://codeload.github.com/substrate-system/a11y/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231580022,"owners_count":18395373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T17:14:41.568Z","updated_at":"2025-09-01T10:31:12.715Z","avatar_url":"https://github.com/substrate-system.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# a11y\n[![tests](https://img.shields.io/github/actions/workflow/status/substrate-system/a11y/nodejs.yml?style=flat-square)](https://github.com/substrate-system/a11y/actions/workflows/nodejs.yml)\n[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver\u0026style=flat-square)](https://semver.org/)\n[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)\n[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)\n[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/a11y?cache-control=no-cache)](https://packagephobia.com/result?p=@substrate-system/a11y)\n[![GZip size](https://flat.badgen.net/bundlephobia/minzip/@substrate-system/a11y)](https://bundlephobia.com/package/@substrate-system/a11y)\n[![license](https://img.shields.io/badge/license-Big_Time-blue?style=flat-square)](LICENSE)\n\n\nFactoring out some common CSS utilities, so there is less duplication\nacross projects.\n\n* [Accessible Icon Buttons](https://www.sarasoueidan.com/blog/accessible-icon-buttons/).\n* [Inclusively Hidden](https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html)\n\n**_featuring_**\n\n* The [`visually-hidden` class](#visually-hidden).\n* [Scrolling + `prefers-reduced-motion` media query](#prefers-reduced-motion)\n\n\u003cdetails\u003e\u003csummary\u003e\u003ch2\u003eContents\u003c/h2\u003e\u003c/summary\u003e\n\n\u003c!-- toc --\u003e\n\n- [install](#install)\n- [Use](#use)\n  * [example](#example)\n  * [Bundler](#bundler)\n  * [CSS imports](#css-imports)\n  * [Link](#link)\n- [API](#api)\n  * [`visually-hidden`](#visually-hidden)\n  * [`prefers-reduced-motion`](#prefers-reduced-motion)\n- [see also](#see-also)\n\n\u003c!-- tocstop --\u003e\n\n\u003c/details\u003e\n\n\n## install\n\n```sh\nnpm i -S @substrate-system/a11y\n```\n\n## Use\nThis package exposes CSS only.\n\n### example\nPut the relevant classes in your HTML.\n\n```html\n\u003cbutton\u003e\n  \u003csvg\u003e\u003c!--  icon here  --\u003e\u003c/svg\u003e\n  \u003cspan class=\"visually-hidden\"\u003eMy Cool Button text\u003c/span\u003e\n\u003c/button\u003e\n```\n\n### Bundler\nIf using a bundler, import the package as normal.\n\n```js\nimport '@substrate-system/a11y'\n```\n\n#### Or import specific things\n\n```js\nimport '@substrate-system/a11y/visually-hidden'\n```\n\nOr minified:\n```js\nimport '@substrate-system/a11y/min'\n```\n\n### CSS imports\n\nImport in CSS:\n\n```css\n@import url(\"../node_modules/@substrate-system/a11y/dist/index.min.css\");\n```\n\n### Link\nIf you don't want to use a bundler, this package exposes minified CSS files too.\nYou can copy them to a location that is accessible to your web server, then link\nto them directly in HTML.\n\n#### copy\n```sh\ncp ./node_modules/@substrate-system/a11y/dist/index.min.css ./public/a11y.css\n```\n\n#### HTML\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003clink rel=\"stylesheet\" href=\"./a11y.css\"\u003e\n\u003c/head\u003e\n\u003c/html\u003e\n```\n\n## API\nThis package exposes CSS that will look for the following classes.\n\n### `visually-hidden`\nUse this to create accessible buttons with no visible text.\n\nSee [this article](https://www.sarasoueidan.com/blog/accessible-icon-buttons/).\n\n#### Bundler\n```js\nimport '@substrate-system/a11y/visually-hidden'\n```\n\n#### CSS Import\n```css\n@import url(\"../node_modules/@substrate-system/a11y/dist/visually-hidden.min.css\");\n```\n\n#### example\n```html\n\u003cbutton\u003e\n    \u003csvg\u003e\u003c!--  icon here  --\u003e\u003c/svg\u003e\n    \u003cspan class=\"visually-hidden\"\u003eButton text\u003c/span\u003e\n\u003c/button\u003e\n```\n\n### `prefers-reduced-motion`\nDisable smooth scrolling if the `prefers-reduced-motion` media query is set.\n\n#### Bundler\n\n```js\nimport '@substrate-system/a11y/reduced-motion'\n```\n\n#### CSS Import\n\n```css\n@import url(\"../node_modules/@substrate-system/a11y/dist/reduced-motion.min.css\");\n```\n\n## see also\n\n* [Accessible Icon Buttons ](https://www.sarasoueidan.com/blog/accessible-icon-buttons/)\n* [Inclusively Hidden](https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html)\n* [How to animate scrolling to anchor links with one line of CSS](https://gomakethings.com/how-to-animate-scrolling-to-anchor-links-with-one-line-of-css/#accessibility-concerns)\n  -- scrolling + accessibility\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubstrate-system%2Fa11y","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubstrate-system%2Fa11y","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubstrate-system%2Fa11y/lists"}