Tailwindcss: [Feature Request] Max Content

Created on 21 Jul 2019  路  8Comments  路  Source: tailwindlabs/tailwindcss

馃憢 Hey, I'd be very keen to add six new classes to Tailwind:

width: max-content;, which would be written in Tailwind as w-content
min-width: max-content;, which would be written in Tailwind as min-w-content
max-width: max-content;, which would be written in Tailwind as max-w-content
height: max-content;, which would be written in Tailwind as h-content
min-height: max-content;, which would be written in Tailwind as min-h-content
max-height: max-content;, which would be written in Tailwind as max-h-content

Very keen to get my hands a bit dirty and add this myself, but curious on people's thoughts as to whether or not the general consensus is for or against these additions.

Most helpful comment

Anyone progress been made on this? Ran into this not being included out of the box as well unless I missed it. Implemented it within the config file but still would be nice not having to do as such.

All 8 comments

Hey, if I am not totally lost you can just add this to your configuration, as max-width is already there.

// tailwind.config.js
module.exports = {
  theme: {
    maxWidth: {
      ...,
      "content": "max-content"
    }
  }
}

My opinion is that this does not meet the threshold to be widely useful in order to be added to the default configuration.

Yeah, that's fair enough. I've already done something very similar for personal projects, just thought it might be a nice addition to Tailwind is all.

yeah, I need this functionality.
this feature should be added out of the box into vanilla tailwind css.

yeah, I need this functionality.
this feature should be added out of the box into vanilla tailwind css.

Thanks, @imannms. If this gets more traction I'll look into doing this

We don't include this by default because it has no Edge or IE support, but you can add it to your config file if you need it 馃憤馃徎

Closing for now, can revisit in the future if there's a lot of demand for it as a default.

@adamwathan Can we reopen this? It's a useful and standard part of CSS with full support in all browsers except only IE https://developer.mozilla.org/en-US/docs/Web/CSS/width#Browser_compatibility

Yep I actually have it on my to-do list to add max-content and min-content soon 馃憤

Anyone progress been made on this? Ran into this not being included out of the box as well unless I missed it. Implemented it within the config file but still would be nice not having to do as such.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulhuisman picture paulhuisman  路  3Comments

jbardnz picture jbardnz  路  3Comments

spyric picture spyric  路  3Comments

lamberttraccard picture lamberttraccard  路  3Comments

smbdelse picture smbdelse  路  3Comments