Time to Read: ~1 minI've been debugging a lot of CSS that's contained in ephemeral UI components (basically, items that are temporarily added to the DOM when hovered). I found this technique useful for debugging CSS inside these elements. It essentially halts JavaScript until you resume it from the debugger.
Type this into your developer tools Console:
setTimeout(() => { debugger; }, 5000);
It'll give you 5 seconds to interact with the page and get the element you want to appear. Developer tools will jump to the Sources tab now that you're in debug mode, and you can toggle over to Elements to do your work. When you're done, go back to Sources and click the play icon to resume (or use F8 or Command-)
Related Posts
There are 23 other posts like this one. Here are some other recent ones:
February 12, 2023
If you need to automatically create Google Calendar events from data in a Google Sheet, this pared-down example should work well for you.
October 10, 2021
I created this Shakespeare Insult Generator: it converts three arrays of adjectives and nouns into a delightful random insult that would have thrilled the Bard himself.
November 26, 2020
I decided to create a page that talked about what I was training for, and provided a way for me to provide bits of commentary as the training plan unfolded. The result is a nice mix of Eleventy magic, a CSS-only toggle switch, and the checkbox hack.