Hacker News new | past | comments | ask | show | jobs | submit login

Out of these, only the last one seems somewhat okish to me. But it would be annoying to add another selector everytime you add a class that uses the rule.

If that is all we have, then I will just stick to css variables:

    :root {
      --info-font-size: 8px;
    }

    .info {
      font-size: var(--info-font-size);
      color: grey;
    }

    .news {
      font-size: var(--info-font-size);
      color: black;
    }



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: