Earlier quoted context omitted.
Most likely because your JS blocker also blocks custom fonts. It works fine without JS.
It does not: with JS blocked, the stylesheet for the webfont never gets injected. Even though it shouldn't need injecting in the first place.
Font with Built-In Syntax Highlighting (2024)
31–39 of 39 posts
Re: Font with Built-In Syntax Highlighting (2024)
#32Earlier quoted context omitted.
It does not: with JS blocked, the stylesheet for the webfont never gets injected. Even though it shouldn't need injecting in the first place.
I'm 100% sure it does. Check again.
Re: Font with Built-In Syntax Highlighting (2024)
#33Earlier quoted context omitted.
I'm 100% sure it does. Check again.
Then 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 syntax, meaning it will do nothing (template content is inert) until JS clones that template into the DOM as active content.
Re: Font with Built-In Syntax Highlighting (2024)
#34Earlier quoted context omitted.
Then 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 syntax, meaning it will do nothing (template content is inert) until JS clones that template into the DOM as active content.
That's for the code-editor webcomponent, the rest of the site doesn't use JS.
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.
Re: Font with Built-In Syntax Highlighting (2024)
#35Earlier quoted context omitted.
That's for the code-editor webcomponent, the rest of the site doesn't use JS.
Correct. 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.
Re: Font with Built-In Syntax Highlighting (2024)
#36The whole post proves the opposite is true!
Re: Font with Built-In Syntax Highlighting (2024)
#37665 points | 137 comments
Re: Font with Built-In Syntax Highlighting (2024)
#38I view stuff like this kind of like code that fits into a bootloader or whatever. It’s really more of the technical challenge than to actually solve a problem. The result is much better if you just run a script on your hand-coded file to add syntax highlighting as DOM elements. Still, love seeing stuff like this.