Is there any good method to keep the collider constant while the local scale shrinking or expanding

I have a button game object which attached a box collider.
Now I want to make my collider to keep constant when the button is shrinking or expanding.
I know i can update the collider size in the Update()to force the collider keep constant.But I want to know if there is any other good way to do that or is there any way to get the animation curves at the run time.

The only suggestion I have - other than updating the collider size when you scale the object is to separate the visual representation of the button from the collision.

For example you probably have it setup now as just one game object “Button”. I suggest instead having your button be a composite of the visual and collision elements:

ButtonObject
- VisualElements
- Collision

With the object being made up of three separate objects you get a lot of power. When you move / scale ButtonObject you move / scale both the visuals and the collision object. But you can also move / scale either the visual or collision elements separately from each other.