From 3ac2f87e08b8155ef2417f1937f24ac931d30d24 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 3 Feb 2026 17:44:28 +0000 Subject: [PATCH] Try adding flags to make chrome's rendering consistent --- packages/shared-components/vitest.config.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/shared-components/vitest.config.ts b/packages/shared-components/vitest.config.ts index 32a0f9ae24..15429cec81 100644 --- a/packages/shared-components/vitest.config.ts +++ b/packages/shared-components/vitest.config.ts @@ -89,6 +89,20 @@ export default defineConfig({ enabled: true, headless: true, provider: playwright({ contextOptions: { reducedMotion: "reduce" } }), + providerOptions: { + launch: { + args: [ + '--disable-gpu', // Disables GPU hardware acceleration. If software renderer is not in place, then the GPU process won't launch. + '--disable-gpu-rasterization', // Disable GPU rasterization, i.e. rasterize on the CPU only. Overrides the kEnableGpuRasterization flag. + '--disable-gpu-compositing', // Prevent the compositor from using its GPU implementation. + '--disable-font-subpixel-positioning', // Force disables font subpixel positioning. This affects the character glyph sharpness, kerning, hinting and layout. + '--disable-software-rasterizer', // Disables the use of a 3D software rasterizer. (Necessary to make --disable-gpu work) + '--ppapi-subpixel-rendering-setting=0', // The enum value of FontRenderParams::subpixel_rendering to be passed to Ppapi processes. + '--force-device-scale-factor=1', // Overrides the device scale factor for the browser UI and the contents. + '--force-color-profile=srgb', // Force all monitors to be treated as though they have the specified color profile. + ], + } + }, instances: [{ browser: "chromium" }], }, setupFiles: [".storybook/vitest.setup.ts"],