How to Make a Media Query-less responsive Card Component
Here are the CSS ingredients we used for a media-query-less card component:
- The
clamp()function helps resolve a “preferred” vs. “minimum” vs. “maximum” value.- The
flex-basisproperty with a negative value decides when the layout breaks into multiple lines.- The
flex-growproperty is used as a unit value for proportional growth.- The
vwunit helps with responsive typography.- The
object-fitproperty provides finer responsiveness for the card image, as it allows us to alter the dimensions of the image without distorting it.