Ugh, I don't really feel like arguing with anyone right now about Tailwind, but it's discouraging to me that it's becoming so mainstream that the react docs are now using it. Literally the first element on your page contains some combination of responsive bugs (or at the very least redundant properties):
Basically, it is hidden for every viewport except lg, despite there being explicit styling for md and sm viewports. Which is unfortunate given that the consequence is hiding something designed to promote a good cause. Because tailwind begins to look like hieroglyphics to me once a class has more than a handful of properties, I'll translate it to (s)css and try to understand the intent for each breakpoint:
First, it's pretty clear that display: flex should at least coincide with flex-direction:row and thus be moved to the sm breakpoint (or in tailwind terms, lg:flex should be changed to sm:flex). What confuses me most is the display: hidden. Was the intent to have this not show up on mobile at all? I'm skeptical, because if so, then the py-2 and flex-col properties don't make sense as they are immediately overwritten at the first breakpoint where it actually does become visible. My guess is hidden was added as a panic fix because someone didn't know how to make it work in mobile, and accidentally broke it for everything but lg. In fact, just removing the hidden entirely fixes it for all but the smallest viewport (when the text begins to wrap), but changing height: 40px to min-height: 40px handles that.
Which is unfortunate given that the consequence is hiding something designed to promote a good cause.
Yeah, the problem there is that we've had bad random navigation glitches on iOS when we kept it position: sticky. Its mobile support still isn't great in WebKit. And making it always fixed as a permanent element you can't scroll away takes too much screen estate on mobile. The link is also not very useful on mobile (e.g. facebook mobile site just breaks with it) but it's the only one we could get approved by the lawyers. So I think it made sense to omit.
I don’t think you should need to make it sticky — just the nav bar (which already is). At least on my version of iOS, it looks fine on mobile with basic navigation: https://streamable.com/frx4y6
Out of curiosity, was it an issue when the address bar is on the top? I’ve had nightmares wrestling with any sort of fixed elements and how they interact (or more specifically how they don’t interact) with floating browser ui elements across different engines
24
u/rickhanlonii React core team Mar 17 '23
It’s built on Next with tailwind. Check out the beta directory here: https://github.com/reactjs/reactjs.org