Changing the box dimensions depending on the face size

I have blocks that are procedurally generated. And I want to select its edges, something like a frame. I do it through the material using the GeneratedRoundRect function, drawing a box on the edges of the face.

But the problem is that the more the width or height of one face, the more the box is stretched. Since UV coordinates do not change, but remain always from 0 to 1. For this reason I need to calculate the BoxDimension depending on the face size.

I do this by passing the parameters through the VertexColors. But this solution takes up two channels of VertexColors and may become a problem in the future if I need this parameter.

Is there any other solution to this problem? Pass the parameters in another way or get the dimensions of the face in the material?