TLDR Web Dev · ARTICLES & TUTORIALS

THE TWO-TREE PROBLEM WITH STYLING ON THE WEB

links.tldr.tech8 min read

Summary from the TLDR Web Dev newsletter

One of the root problems with web styling is the “two-tree problem,” which is the need to maintain separate, interconnected trees for document structure (HTML) and styles (CSS). TailwindCSS solves the two-tree problem with atomic CSS, but its composability is limited due to potential CSS class conflicts. Styled components offer composability, but don't solve the two-tree problem. Inline styles combined with JavaScript can handle most styling needs without running into the two-tree problem.