Flex Basis
Controls the initial size of flex elements.
Utility | Properties |
---|---|
Error: 429 |
This example showcases various flex-basis
utilities:
- The fb-0 flex basis utility sets the flex-basis property to 0rem, allowing the item to have no initial size.
- The fb-50 flex basis utility sets the flex-basis property to 12.5rem, giving the item a base size of 12.5rem.
- Finally, fb-full flex basis utility sets the flex-basis property to 100%, allowing the item to take up the full width of its container.
A
B
C
<div class="tc-white" id="area"> <div class="d-f g-4 h-24 w-full"> <div class="ai-c bg-indigo d-f fb-0 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f fb-50 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f fb-full jc-c p-4 rad-1">C</div> </div></div>
Conditional styles
Learn how to override existing utilities based on the userโs screen size or other factors, such as hover states.
Media modifier
You can combine responsive breakpoints like sm:-*
,md:-*
, lg:-*
, and xxl:-*
allows targeting specific utilities in different viewports.
<div class="fb-1 md:fb-2 ..."></div>
Hover modifier
Alternatively, you can apply :hover
by using h:-*
utility to override elements and change their values when hovering over them.
<div class="fb-1 h:fb-2 ..."></div>