4 ms·
> The colors in the HTML snippet above comes from within the font itself, the code is plain text, and requires no JavaScript. But then why does the color disap
by TheRealPomax 10mo ago
> The colors in the HTML snippet above comes from within the font itself, the code is plain text, and requires no JavaScript.
But then why does the color disappear if I disallow scripts on this page? Instead of your font, now it uses Consolas.
Are you using JS to load the font in? (if so... web fonts don't need JS to load =)
- california-og 10mo agoMost likely because your JS blocker also blocks custom fonts. It works fine without JS.
- TheRealPomax 10mo agoIt does not: with JS blocked, the stylesheet for the webfont never gets injected. Even though it shouldn't need injecting in the first place.
- california-og 10mo agoI'm 100% sure it does. Check again.
- TheRealPomax 10mo agoThen you need to curl the URL, pipe it to an .html file, and then search the resulting file for "@font-face". The only place that has the @font-face rule for this fancy font is inside <template> syntax, meaning it will do nothing (template content is inert) until JS clones that template into the DOM as active content.
- california-og 10mo agoThat's for the code-editor webcomponent, the rest of the site doesn't use JS.
- TheRealPomax 10mo agoCorrect. The code editor that has the subscript: "The colors in the HTML snippet above comes from within the font itself, the code is plain text, and requires no JavaScript." Which doesn't work without JS. So adding the @font-face to the page itself, so that things works even without JS, would be lovely.
- california-og 10mo agoI think you're seriously confused or purposefully trolling. That's not the web component I'm talking about, that's just plain html.