Sizing with variables

Can we minimize the design system when we go for the size? For example, we have 3 types of buttons, each with 4 sizes (XL, L, M, S). It would be a matrix for not only designers but also developers, testers, etc. Could we use variables to solve this problem? I’ve tried, and it does work but the code syntax is quite confusing.

Code syntax? Mind to expand?