Make Theme.resolveAttribute support resolveRefs

When resolveRefs is true, reference attributes must be walked until the actual resource is found.