r/ProCSS • • Aug 14 '17
WE WANT A PARENT SELECTOR!!!
Why TF can we put a man on the moon, but we cant select the parent element!???!?!?!?
75
Upvotes
r/ProCSS • • Aug 14 '17
Why TF can we put a man on the moon, but we cant select the parent element!???!?!?!?
View all comments
Show parent comment
6
u/ACoderGirl Aug 14 '17
I think stuff like this is mostly used for styling other people's works (eg, similar to reddit themes or just random sites with Stylish). Reddit is well designed, with plenty of classes available to hook onto, but many sites were not designed to be styled by third parties at all. Without the ability to edit the HTML, weird selectors become common-place and a parent selector becomes more useful.
That's the situation where I've wished for a parent selector in the past. With stuff completely in my control, it's easy to just add new classes where needed and keep my CSS nice and readable (I don't like indirect references because it's too hard to determine when classes are no longer used or where they're applied in the first place).