The only use case I can think of for custom JavaScript is replacing img
elements, which is difficult to do in CSS (especially with a character limit, which throws base64 out):
/* This is a dirty hack that only works because an image proxy is under the Kagi domain. */
.logo_doggo {
background-image: url("https://kagi.com/proxy/golden-retriever-wallpaper.jpg?c=Lbz3FTuwfcdEev2OUYTdXSp1_s6IAoUjvK1-t8YUmOHcSZWrXLI-zhJoRBYgo4leh56bSl0zL70A8MiDN9be2ju6BDIA9ryYlGs0utiEkzEv2iTFvEEfgEeIraQWqHWpLlZfUv7L3m2xPeUZ8rq1ijQUgWexp3esx5HZy5E4H8E%3D");
background-size: 60px 55px;
height: 55px;
}
.logo_doggo svg {
display: none;
}
// Compared to JavaScript
document.querySelector('.logo_doggo').innerHTML = 'some image';
I suppose you could also use it to dynamically style search results based on the domain.