보간법(interpolation)을 사용하여 설정을 직접 사용할 수 있다고 생각합니다.
background: transparent URL("$#{$hat_type}") top left no-repeat;