Twitter | Pretraživanje | |
Mathias Bynens
🎉 Chrome now supports SVG favicons! Pro tip: you don’t need any HTML to declare a favicon. Host your SVG file at /favicon.ico and serve it with the correct MIME type (image/svg+xml). 🤯
Reply Retweet Označi sa "sviđa mi se" More
Nathan Gathright 19. stu
Odgovor korisniku/ci @mathias
Since you can put CSS in an SVG, would a `prefers-color-scheme: dark` media query be enough for dark mode support?
Reply Retweet Označi sa "sviđa mi se"
Mathias Bynens 20. stu
Odgovor korisniku/ci @NathanG @jaffathecake
Test case: The media query is ignored. had an interesting write-up on how media queries behave in SVG across browsers: This behavior seems to follow from that.
Reply Retweet Označi sa "sviđa mi se"
Axel Rauschmayer 19. stu
Odgovor korisniku/ci @mathias
Genuine question: Pro tip or a hack that happens to work? Doesn’t seem like a best practice to me(?)
Reply Retweet Označi sa "sviđa mi se"
Mathias Bynens 19. stu
Odgovor korisniku/ci @rauschma
Which part exactly? All browsers request /favicon.ico by default (see link in tweet for my old write-up). And file extensions don’t matter on the web; MIME types do. I see nothing wrong with this.
Reply Retweet Označi sa "sviđa mi se"
Kilian Valkhof 19. stu
Odgovor korisniku/ci @mathias @polypane
I didn't even realise Chrome didn't support it. It was a no-brainer when I implemented support for them in .
Reply Retweet Označi sa "sviđa mi se"
Mathias Bynens 19. stu
Odgovor korisniku/ci @kilianvalkhof @polypane @WHATWG
The lack of support bothered me everytime I browsed to a spec. Well, not anymore! 👍
Reply Retweet Označi sa "sviđa mi se"
David Anson 19. stu
Odgovor korisniku/ci @mathias
Is the recommendation to use server-side browser sniffing to know when SVG is supported, or is there a clean way to statically return ICO/PNG/SVG in a way that lets the browser choose?
Reply Retweet Označi sa "sviđa mi se"
Mathias Bynens 20. stu
Odgovor korisniku/ci @DavidAns
The static solution is to use <link rel="icon" type="…">. For a server-side solution, browser sniffing seems overkill for this purpose. If we could tweak the Accept header Chrome sends for such requests, it might be easier:
Reply Retweet Označi sa "sviđa mi se"
Xavier Perseguers 20. stu
Odgovor korisniku/ci @mathias
What I dislike is that ICO file format is originally a container for BMP and PNG. So having a favicon.ico served with mime-type image/svg+xml sounds semantically wrong to me ^^
Reply Retweet Označi sa "sviđa mi se"
Mathias Bynens 20. stu
Odgovor korisniku/ci @xperseguers
Both URLs in my tweet don't have any extensions at all. The same goes for the Twitter URL of this very tweet. Is that semantically wrong too? It's just a URL. Extensions don't matter on the web; MIME types do.
Reply Retweet Označi sa "sviđa mi se"