You can put your element of interest in a div. Then you can move the css * border from your element to the outer div. Then you can apply scaling ** to the source element; the border (now in the outer div) should not be affected.
* (and possibly other attributes, such as absolute positioning, size, etc.)
** (any further transformations, such as rotations or 3d transforms, can then be applied separately to the outer div)
source share