Is it possible to use the element ID as a variable?

Need to dynamically assign a background image depending on the ID. Something like this:
@each .class elementa {
 background: url(/images/#{$id-bold}.jpg)
}
July 4th 19 at 23:05
1 answer
July 4th 19 at 23:07
@each $name in 'save' 'cancel' 'help' {
 .icon-#{$name} {
 background-image: url('/images/#{$name}.png');
}
}

the output
.icon-save {
 background-image: url("/images/save.png");
}

.icon-cancel {
 background-image: url("/images/cancel.png");
}

.icon-help {
 background-image: url("/images/help.png");
}

Find more questions by tags Sass