
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
cypress-forced-colors
Advanced tools
⚠️ For full forced color emulation, the browser you are testing on must be Chromium > 98.
This library contains helper cypress methods to enable and disable forced colors emulation in chromium borwsers through the chrome devtools protocol.
The devtools APIs used by this library can be found on the official chrome devtools protocol docs.
Forced colors is a browser mode where color CSS properties are overriden. You can find a full list of affected properties on the MDN docs. This browser feature is leveraged notably by Windows High Contrast Mode, which will override all colors with system colors to provide more contrast for users that need it.
Chrome devtools has media emulation as a stable feature and in version 98, supports full emulation of forced colors. This plugin can be used to have an easy way of testing acessible high contrast designs without needing a windows machine or enabling a windows os feature.
npm install --save-dev cypress-forced-colors
Add the following code to your cypress support file.
// cypress/support/index.js
// cypress/support/index.ts
import 'cypress-forced-colors';
Once the custom commands are registered with cypress you can enable or disable forced color mode in your tests.
it('Test with forced colors mode', () => {
cy.enableForcedColors('dark');
// your test code...
cy.disableForcedColors();
})
You can also use this for test suites
describe('Forced color tests', () => {
before(() => {
cy.enableForcedColors('dark');
});
after(() => {
cy.disableForcedColors();
})
})
⚠️ Make sure you use a Chromium browser with version > 98
You can try out this feature from this repository. Simply clone the repo and run the following commands to open cypress and test to see the example test suite.
npm install
npm start
FAQs
Cypress commands to enable and disable browser forced colors mode
The npm package cypress-forced-colors receives a total of 1 weekly downloads. As such, cypress-forced-colors popularity was classified as not popular.
We found that cypress-forced-colors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.