1. 程式人生 > >Ask HN: Where does one find modular CSS components?

Ask HN: Where does one find modular CSS components?

By "modular CSS components," what I mean is reusable prototypes of styled HTML user interface components -- checkboxes, pretty tables, attractive forms -- within which (and this is the important thing) all styling rules are scoped to some block-level container, be it a <section> or <div>.

Codepen, and many other sites like it, have beautiful demos of working components. However those components are seldom portable because Codepen imposes no constraints on styling rules. The rendered document is served in a distinct iframe, and authors are allowed to style whatever global attributes they wish. So using an attractive, striped accordion table someone else made is rarely trivial since the styling rules aren't scoped to a container; the "container" is the html and/or body of the document, so you have to be willing to either manually fine-tune the document's css selectors (i.e., scope them to a block-level component) or render the component in an iframe (which no one wants to do).