Hacker News new | ask | show | jobs
by ninjaranter 3339 days ago
I liked basscss in principle, but I feel like the following examples from the homepage are missing the point/ will lead to un-maintainable code.

  <h2 class="h1">Larger than default h2 style, but semantically correct</h2>
... why not just use a h1?

I also don't see how

  <p class="bold text-decoration-none caps">Bold</p>
is a big step up from doing

  <p style="font-weight: bold; text-transform: uppercase; text-decoration: none">Bold</p>
Am I missing the appeal here?
3 comments

> ... why not just use a h1?

Because the HTML tags you choose affect document structure and SEO. CSS classes don't; they only affect aesthetics.

As for the second point, at least how I use it, is that I can create a higher-order class from those "atomic" classes like bold, etc. So I'd do in Sass:

  .paragraph--emphasize {
    @extend .bold, .text-decoration-none, .caps;
  }
Then apply that class on the paragraph. This way, the resulting CSS is very compact: the above gets compiled so that the higher-order class uses the same styles as the atoms that compose it.
> <h2 class="h1">

wow, i just threw up in my mouth

Yea, it should be:

    <h2 class="larger">
or something. Using elements as class names is insane.
Thx for the laugh, as someone pretty css-agnostic I love watching everyone's rather intense opinions on css frameworks.