4 ms·
The difficulty I imagine with that is for components whose subtree's styling is modified upon interaction via JavaScript. For instance, a drop down that gets ex
by aerovistae 7y ago
The difficulty I imagine with that is for components whose subtree's styling is modified upon interaction via JavaScript. For instance, a drop down that gets extra classes when you click on it causing it to appear. How do you account for that?
- mrieck 7y agoIt doesn't account for user interaction but I might attempt to do something for that in the future. The desktop version uses puppeteer so I do force a hover state on each element and get extra psuedo selectors by doing that. I'm also planning to add something so you can interact with the page first to get the page in the state you want, because right now the selection process cancels all other events (you select something by clicking). One of the first difficult issues that I ran into was that I had to modify CSS selectors to target the subtree. For example let's say there is a selector: #mysidebar #atable tr Now I only want to Snip/Extract the #atable element. I have to modify the selector by chopping off #mysidebar because the html I'm giving the user is just #atable and everything below that. The problem is modifying selectors like that ruins CSS specificity. That's just one example of how things became a lot more complicated than I originally thought it would be.