Using Drupal Commerce, is there a way to adjust the variation price base on the first or second variation selected?

For example I have 3 variations: size, material, color. If I choose Small (that costs $5) and material that costs $10 ($15 total), then when I choose Large at $12, the material should cost $20.

I guess I should use rules. Has anyone done this?