Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I hadn't considered that at all because they're so little used, but it would be an issue if they became so. I'm using Stylus for user styles nowadays which provides an option to allow you to target the CSS within an IFRAME using

    html[stylus-iframe$="twitter.com"] h1 { display:none }
and I guess they could provide a similar sort of hack to select the Shadow DOM of an element to apply CSS e.g.

    .comment:shadow .title { font-size: 1.1rem; }
Seems pretty likely to be be a performance hog to do that though.


Yeah, I don't see Shadow DOM often, but there are couple sites I use that employ it - most notably Gerrit. Since I use it almost every work day, I wanted to fix a bunch of UX annoyances it has. Those fixes would've normally been trivial, but Gerrit UI has everything wrapped in multiple levels of Shadow DOM, making those fixes near-impossible instead to do in Stylus alone.


Some combination of Tampermonkey, MutationObserver and IntersectionObserver almost always gets there in the end, but despite having a default user script template with this exact skeleton it's a lot more of a pain in the arse to achieve what a simple CSS selector and some properties does in a few lines...


Exactly. And for me, that difference in PITA is the difference between fixing up websites in Stylus incrementally, spending a couple minutes for a CSS rule or three when something annoys me, vs. making a note on my TODO list to write the necessary code later, and never getting around to doing it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: