|
| ▲ | handsclean 16 hours ago | parent | next [-] |
| I’d argue it’s a strength. You still have classes and custom attributes to reach for when you want an (effectively) unordered set, the difference is just that you define some boundary that’s exclusive. This reflects reality. Some helper classes work together by just slapping them together, but component-like classes, like a toggle and a hero image, don’t. If you do want to combine them, you need to think about how, potentially rearchitect, and implement it whether you’re using classes or tag names. |
|
| ▲ | dleeftink 18 hours ago | parent | prev | next [-] |
| Good use case for @container, @scope and :has(), where you forgo class definitions and use --custom-properties on the parent scope/container which are inherited downwards based on the existence of a scoped DOM pattern/container query, or 'upwards' by using a :has(child-selector) on the parent. Although be sure to avoid too many :has(:nth-child(n of complex selector)) in case of frequent DOM updates. |
| |
|
| ▲ | danlitt 8 hours ago | parent | prev | next [-] |
| Honestly it depends what you're doing. A tag name is only correct when it unambiguously specifies the content. As in, a header is just a header - there's no "dual nature" that we have to support by allowing multiple tag names. This means the ontology you're representing has to be "linear" - you can have more specific and less specific tags, but never a "fork" where you could really choose either more-specific tag in order to emphasise a different "part" of the tag. Classes should always be for secondary properties, which are not the main "essence" of the content. All I say above is a just a particular way of thinking about document markup, of course. If you don't agree with it, then tags are probably the wrong way to express what you're thinking of. |
|
| ▲ | tomcam 14 hours ago | parent | prev | next [-] |
| Not trying to be rude but to me that is the essence of composition which feels perfect to me |
|
| ▲ | 12 hours ago | parent | prev [-] |
| [deleted] |