Andrey (azangru) wrote,

CSS at its worst — when the order in which the rules are defined in a stylesheet matters, because, given the same selector specificity, the latest defined selector wins.

E.g. given this html structure:

If the child-foo class is defined after the child class, the border will have one color:

But if the child-foo class is defined before the child class, the border will have a different color:

And I was certain — certain — that given that the child-foo class if declared after the child class in the html class attribute, the child-foo will always win. But no, CSS reminded me today about its weirdness.

  • (no subject)

    Watched some parts of the Floyd trial. Got wondering about the testimony of the expert witness, a pulmonologist: Prosecution: Have you formed an…

  • (no subject)

    A conversation with Justin Fagnani about his own history and the history of lit-html and lit-element. The sound production quality is awful, and…

  • (no subject)

    Reminder to future self if he wants to bulk rename a bunch of scss files to .module.scss (because CSS modules), and then update the references to…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.