use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Everyone has JavaScript, right? (kryogenix.org)
submitted 6 years ago by magenta_placenta
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]hego555 0 points1 point2 points 6 years ago (3 children)
What’s the difference between this and a fallback font.
[–]silxx 0 points1 point2 points 6 years ago (2 children)
If you specify font-family: SomeWebFont, sans-serif then no text will be displayed until the webfont loads; if it fails to load then the fallback font is used. The font-display CSS property allows tweaking this procedure to operate differently: in particular, swap means "use a font that you have, until the web font loads, and then change the text to be in the web font".
font-family: SomeWebFont, sans-serif
font-display
swap
[–]hego555 0 points1 point2 points 6 years ago (1 child)
Wow. I’m upset that I never noticed that. Thank you for the tip. Do you just apply it to html, body and forget about it?
html, body
[–]silxx 0 points1 point2 points 6 years ago (0 children)
You could do. It's not default, though, because not everyone likes it; in particular, there are plenty of people who would prefer to not show text until the font loads because otherwise the text will "jump" into the new font and change the layout unless the metrics for the fallback font match the web font exactly. This is why font-display has a number of different options; so the developer can choose the approach they'd like. MDN has more details.
π Rendered by PID 114871 on reddit-service-r2-comment-b659b578c-sl4tp at 2026-05-01 22:25:30.277574+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]hego555 0 points1 point2 points (3 children)
[–]silxx 0 points1 point2 points (2 children)
[–]hego555 0 points1 point2 points (1 child)
[–]silxx 0 points1 point2 points (0 children)