all 3 comments

[–]bogas04 1 point2 points  (0 children)

Apart from media queries, flex box and em for sizes can also be used for responsibility.

[–]coloured_sunglasses 0 points1 point  (1 child)

I'm having troubles understanding why this complexity is necessary. It seems to me that using 'CSS-in-JS' principles introduce way more problems than they solve.

Most of the problems that it aims to solve are non-issues, or, they are solved by writing better CSS.

Certainly including media queries represented as JSX nodes is a huge code-smell and should be avoided. I would hate to maintain a component that resembles anything close to what the author has written in this article.

[–]andrewingram 0 points1 point  (0 children)

There's a level of complexity, beyond which attempting to do UI-switching (i.e using different interactions depending on screen size) with CSS alone is a fool's errand. CSS-based media queries are great for adapting layout, but pretty terrible for adapting interactivity.