jensimmons / cssremedy

Start your project with a remedy for the technical debt of CSS.
Mozilla Public License 2.0
2.19k stars 113 forks source link

Image causes unexpected if used inside intrinsic parent #84

Open thien-do opened 3 years ago

thien-do commented 3 years ago

Hi, I found a bug/interested behaviour when using Tailwind that caused by img { max-width: 100% }. Reading their code, it points to this (marvelous) project so I think you'd be interested too :D

The bug: https://github.com/tailwindlabs/tailwindcss/issues/4211 The playground: https://play.tailwindcss.com/YQ7Rdp8lvn TL;DR:

  1. imgs with percentaged width is considered as extrinsic child when calculating its intrinsic parent
  2. there is a bug (or technically, undefined behaviour) where percentaged max-width are treated as percentaged width (i.e. turning elements to extrinsic child)