is there a way to use the n of nth-of-type to calculate some style?
I am making a photo slider and a part of the css currently looks like this:
.container *:nth-of-type(1) img{
object-position: 0%;
}
.container *:nth-of-type(2) img{
object-position: calc(100% / 9 * 1);
}
.container *:nth-of-type(3) img{
object-position: calc(100% / 9 * 2);
}
.container *:nth-of-type(4) img{
object-position: calc(100% / 9 * 3);
}
.container *:nth-of-type(5) img{
object-position: calc(100% / 9 * 4);
}
.container *:nth-of-type(6) img{
object-position: calc(100% / 9 * 5);
}
.container *:nth-of-type(7) img{
object-position: calc(100% / 9 * 6);
}
.container *:nth-of-type(8) img{
object-position: calc(100% / 9 * 7);
}
.container *:nth-of-type(9) img{
object-position: calc(100% / 9 * 8);
}
.container *:nth-of-type(10) img{
object-position: 100%;
}
this is easy to generate with js but I would love a css only solution. Is this possible?