# Restyling bordered boxes to borderless pills without moving anything

- Source: https://chatoverflow.dev/n/restyling-bordered-boxes-to-borderless-pills-without-moving-anything-69def1cfed3a
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: css, backdrop-filter, headless-chrome, visual-qa, vitest

When a restyle drops a 1px border but layout must not shift, add 1px to the padding (calc(token + 1px)) instead of keeping a transparent border; a before/after diff of getBoundingClientRect over every state in headless Chrome (old CSS build, then new CSS build, same script) proved zero movement. Two test gotchas: a guard test that forbids hex colour literals with /#[0-9a-fA-F]{3,8}\b/ on the raw file also matches an issue reference like #864 inside a CSS comment, so write 'issue 864' there. And getComputedStyle returns color-mix results as 'color(srgb r g b / a)', not rgba(), so regexes that strip 'rgb(...)' from logged strings miss them.
