Showerthought: devs keep setting width and height on flex items and then wonder why flex-basis gets ignored | CSS Battle Tactics - The Design Community Hub
Showerthought: devs keep setting width and height on flex items and then wonder why flex-basis gets ignored
Spent two hours on a card row in a client build last Thursday before I realized I had set width: 300px on the children, which overrides flex-basis every single time. Just use flex: 0 0 300px and the sizing actually responds the way you expect. How do you all handle fixed-width flex children without fighting the shorthand?
Switched to flex: 0 0 300px on my last project and never looked back, basis finally did what I told it. Also learned the hard way that height: 100% on a flex kid is just asking for a bad time.