Marek S. Ł.

@marek@m5l.eu

Currently studying to get a PhD in helicopter flight simulation.
2 ★ 0 ↺

[?]Marek S. Ł. »
@marek@m5l.eu

Some time ago I encountered the same idea on a different blog. It's very brief, but I think the example is more aligned with your point here:

https://pdx.su/blog/2023-07-27-use-css-attributes/

CC: @keithamus@indieweb.social

    ...
    AodeRelay boosted

    [?]Tim Chase »
    @gumnos@mastodon.bsd.cafe

    @marek

    the data-primary certainly fits my point, but the data-color="red" still bugs me since that's presentational rather than structural. I would rather see things like

    <div data-status="error">…</div>
    <div data-status="warning">…</div>
    <div data-status="info">…</div>
    <div data-status="success">…</div>

    and then let the CSS decide that error→red, warning→amber, info→blue, and success→green

    Otherwise I know m̶a̶n̶a̶g̶e̶r̶s̶ projects where we'd end up with things like

    div[data-color="blue"] {
    background-color: purple;
    }

    🤦‍♂️

    @keithamus

      ...
      1 ★ 0 ↺

      [?]Marek S. Ł. »
      @marek@m5l.eu

      @gumnos@bsd.cafe I agree completely, "error" and "info" is exactly what I'd prefer to see there

        History