I just released ng-prism 22.8. Short recap if you haven't seen it before: ng-prism is a component lab for Angular libraries, a Storybook alternative without story files. You put a `@Showcase` decorator on a component, inputs and types are read at build time, and the components render in the same document as the styleguide, no iframe.
The main thing this time: the canvas can simulate the conditions a component is seen under. The tools menu has a Simulate group with reduced motion, a light or dark color scheme, forced colors (the mode behind the Windows contrast themes) and colour vision deficiencies. It applies to the component, its Overview cells and the CDK overlays it opens, never to the styleguide around it, and it's in the URL, so you can link someone to a component in dark mode.
Because there's no iframe, the browser can't emulate `prefers-color-scheme` for just the component. So ng-prism copies every `@media` rule that tests an emulated feature, scopes the copy to the component and switches the original off there. Specificity and cascade order stay intact, `(prefers-color-scheme: dark) and (min-width: 600px)` still follows the window width, and `matchMedia` answers from the simulation too. If your dark mode hangs on a class instead, the config can name it:
```typescript
export default defineConfig({
colorScheme: { dark: { class: 'dark' } },
});
```
Forced colors is an approximation, since a page can't switch the browser into that mode. The first version was too kind: on a real component library, a toggle, a checkbox and a radio button looked fine in the simulation and were broken in Chromium's real mode. So before the release it got rebuilt against Chromium. There are 114 tests now that render the same fixtures in the real mode and under the simulation and compare the computed colours, and on that library 30 of 30 screenshot pairs came out pixel equal.
Other things in 22.8: showcases take real dates (`value: new Date(2026, 3, 28)` in a variant, with a date field in the controls), a component that sets its own `model()` finally shows up in the Events panel, and the canvas no longer changes with the styleguide's dark or light theme.
Question for anyone who checks their components for accessibility: which conditions do you test that this doesn't cover yet? `prefers-contrast`, 200 % zoom, right to left? I'd like to base the next step on what people actually check rather than on my own guesses.
Video voice: elevenlabs.io