![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@shopify/theme-a11y
Advanced tools
A library of useful functions that help make your theme more accessible.
Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project:
yarn add @shopify/theme-a11y
and then import the functions you wish to use through ES6 imports:
import * as a11y from '@shopify/theme-a11y';
If you prefer not to use a package manager, you can download the latest version of Theme A11y and include it in your project manually from the following links:
These files make Theme A11y accessible via the Shopify.theme.a11y
global variable.
Theme A11y uses a method not available in legacy browsers: Element.matches()
. If you wish to support legacy browsers, make sure you add the following dependencies to your project:
yarn add element-matches
and then import them before you import Theme A11y:
// Only need to import these once
import 'element-matches';
// Import @shopify/theme-a11y anywhere you need it
import * as a11y from '@shopify/theme-a11y';
Add a descriptive message to external links and links that open to a new window.
elements
- Specific elements to be targetedoptions.messages
- Custom messages object to overwrite with keys: newWindow, external, newWindowExternaloptions.messages.newWindow
- When the link opens in a new window (e.g. target="_blank"
)options.messages.external
- When the link is to a different host domain.options.messages.newWindowExternal
- When the link is to a different host domain and opens in a new window.options.prefix
- Prefix to namespace "id" of the messagesFAQs
A library of useful functions that help make your theme more accessible.
The npm package @shopify/theme-a11y receives a total of 627 weekly downloads. As such, @shopify/theme-a11y popularity was classified as not popular.
We found that @shopify/theme-a11y demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.