This repository demonstrates a bug encountered when using Tailwind CSS's flexbox utilities with fractional widths. The expected behavior is for the two divs to equally share the available space. However, the actual behavior shows that they do not distribute the space correctly, leading to unexpected layout issues.
The provided JavaScript code shows a simple component with two divs using w-1/2
class to occupy half the width each. However, the divs do not always divide the space evenly, resulting in unexpected behavior.
The solution involves ensuring proper parent container settings for the flexbox to work as expected. This usually involves explicitly setting the parent width or using flex-grow
property.
npm install
to install dependencies.