2
lorentz
1y

font-family expects a comma-separated list. Fonts haven't been displaying on my blog for months because of this issue.

Why could NONE of the browsers I tested this on give me a real syntax error instead of "invalid property value" which could mean literally anything.

Edit: Actually, why can't the CSS plugin for VSCode tell me that I'm making a syntax error in the value of a well-known property?

Comments
  • 2
    Would the W3C CSS checker have found it? https://jigsaw.w3.org/css-validator...

    I use that, and https://validator.w3.org/ for the markup, and https://wave.webaim.org/ for basic accessibility validation.
  • 1
    Guess same way as a scale will not give an error to the baker when he adds to much flour for making his bread ?

    Why is it so hard today to see dev as a profession like a car mechanic or baker ? Learn and rely on the knowledge to do stuff, not waiting until an AI gives you an error for you.
  • 2
    @Grumm It's not unrealistic to expect a parser to tell me which state it failed in and what would've been the acceptable input continuations. In fact, it's very unprofessional to include a parser in high-profile projects that *doesn't* provide this information. That's like a scale that has one led which lights up when load exceeds 1kg.

    Of all dev tools I ever used, only web browsers and SQL databases actually do this, and even a database tells me which character failed to parse.
  • 1
    It's also not unrealistic to look in issue tracker of said extension, then see a ton of side issues and last commit dating months ago. In the best case scenario anyway...
  • 0
    @lbfalvy Sure, but again these are just tools. We shouldn't only follow what they tell you.

    It is like blaming a hammer for bending the nail once in a while.

    plugins are not always 100% without bugs.

    Using the W3C checkers are also helpful.
  • 1
    @Grumm I spent many hours debugging font loading before I realized that this was the actual issue. I'm not blaming the tools, just missing a feature that would have been firmly within scope for a browser's dev console, much easier to implement than for anything else involved, and would have saved me a lot of time.
  • 1
    @Grumm @Fast-Nop I wasn't aware that this was a syntax error
  • 0
    @lbfalvy The nasty thing with browsers is that they try to interpret whatever shit you throw at them. So if the syntax is off, you can get weird cross-browser behaviour that is hard to debug. That's why I check the validity routinely so that I don't waste time.
  • 0
    Yeah... browsers can show web pages just fine even when they are missing <head> and <body> tag.
  • 0
    @daniel-wu Well that is actually a html 5 thing :

    https://geeksforgeeks.org/explain-t....

    Head and body are not mandatory.
Add Comment