Why can’t I tan in the sun on Shabbos? And am I allowed to sit in the sun on Shabbos because I like how it feels?
According to a number of poskim, one should not sit in the sun in order to suntan on Shabbos. There are one of two reasons given, either because it is paining the body. Although he enjoys the look of the suntan afterwards, at the time when he is sitting in the sun it is painful. The other reason is because it is similar to coloring (Tzovaiah). However if the person is honestly sitting in the sun for enjoyment, and he happens to get tanned then it is permitted.
Chelkas Yackov O:CH footnote to siman 152, Minchas Yitzchok 5-32 (2), Machze Eliyahu 1-65 (22), KItzur HIlchos Shabbos 21-4, Emes L’yackov ftnt. 377, R’ Belski zt”l quoted in Halachically Speaking 3-5 ftnt. 47, R’ Heineman shlit”a quoting R’ Moshe Feinstein zt”l.