If my understanding is correct, it seems like you are in need of a solution for creating classes or attributes based on variables. One approach could be to utilize mixins. As suggested in the comments, looping over a map can help generate a range of classes.
// Create a mixin for generating a class
@mixin width-class($width) {
.width-#{$width} {
width: #{$width}px;
}
};
@include width-class(234);
// .width-234 {
// width: 234px;
// }
// Create a mixin for setting an attribute
@mixin width-attr($width) {
width: #{$width}px;
};
div {
@include width-attr(567);
}
// div {
// width: 567px;
// }
// Loop through a map using a mixin to create classes
$width-map: (
100,
200,
300,
400
);
@each $width in $width-map {
@include width-class($width);
}
// .width-100 {
// width: 100px;
// }
// .width-200 {
// width: 200px;
// }
// .width-300 {
// width: 300px;
// }
// .width-400 {
// width: 400px;
// }