Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Axe rules to check against APCA bronze and silver+ conformance levels.
This package contains custom axe rules and checks for APCA Bronze and Silver+ conformance levels.
npm install --save-dev axe-core axe-apca
import axe from "axe-core";
import { registerAxeAPCA } from 'axe-apca';
registerAxeAPCA('bronze'); // or registerAxeAPCA('silver');
// consider turning off default WCAG 2.2 AA color contrast rules when using APCA
axe.configure({
rules: [{ id: "color-contrast", enabled: false }]
})
axe.run(document, (err, results) => {
if (err) throw err;
console.log(results);
});
To set custom thresholds for APCA checks, follow these steps:
custom
as the first argument when calling registerAxeAPCA
.fontSize
and fontWeight
arguments.const customConformanceThresholdFn = (fontSize, fontWeight) => {
const size = parseFloat(fontSize);
const weight = parseFloat(fontWeight);
return size >= 32 || weight > 700 ? 45 : 60;
};
registerAxeAPCA('custom', customConformanceThresholdFn);
To run eslint (including prettier as a formatter) you can run
npm run lint
To have eslint fix any autofixable issue run
npm run lint:fix
Tests are run by web-test-runner in combination with playwright against chromium, firefox and webkit
npm run test
For watch mode
npm run test:watch
TBC
Copyright 2023 Stack Exchange, Inc and released under the MIT License.
FAQs
Axe rules to check against APCA bronze and silver+ conformance levels.
The npm package axe-apca receives a total of 0 weekly downloads. As such, axe-apca popularity was classified as not popular.
We found that axe-apca demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.