Skip to content

Fluid Margin Sizes Removed? #3525

Answered by simonswiss
bobwurtz asked this question in Help
Discussion options

You must be logged in to vote

Hey @drj378!

The fraction/percentage values have been moved out of the spacing scale in Tailwind v2.0 (after being there for a bit in the 2.0 alpha versions), as you can see in this pull request.

They are still available on things like width, inset, translate... but not for margins. There aren't many use cases where these are useful.

You can achieve this "centered 10/12" container like in your example with something like CSS grid:

<div class="grid grid-cols-12">
    <div class="col-span-10 col-start-2 bg-indigo-500 h-8"></div>
</div>

If you want, you can also re-enable the fraction margins by extending your margin theme key and adding these fractions.

I have made a little Tailwind Play sh…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bobwurtz
Comment options

Answer selected by bobwurtz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants