Skip to content

Components library #464

Answered by tipiirai
MentalGear asked this question in Q&A
Discussion options

You must be logged in to vote

Standards-first component libraries should prioritize semantic HTML elements, only introducing class names when native solutions like nested selectors, :has(), or semantic elements become impractical.

Consider a search input with an icon. You could achieve this through pure CSS using background-image with a [type=search] selector. Alternatively, when more control is needed:

<div class="search-input">
  <input type="search">
  <svg/>
</div>

This balance between semantic purity and practical flexibility is key. Design systems should harmonize global styles with component libraries, serving both single-page and multi-page applications. These individual systems I'm currently working on will i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MentalGear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants