Tailwindcss: Helpers for box-sizing

Created on 4 Dec 2017  路  4Comments  路  Source: tailwindlabs/tailwindcss

Hey,

while working on my project, I found that helpers for box-sizing are missing.
If this is considered useful I'd try to contribute them :)

Most helpful comment

@adamwathan any plans on revisiting this? I have a few sites where I've needed to add this manually and I feel like it should be a part of core just like userSelect or appearance are.

All 4 comments

You might already be aware of this, but you can create your own utilities in Tailwind. I know they're probably not intending to get 100% coverage of CSS properties because the default stylesheet would be gargantuan. However, they've done an incredible job making it simple to customize and extend the framework.

Here's one way you could make your own box-sizing utility classes. You would just add something like this at the end of your main stylesheet. By wrapping the classes in the @responsive directive, Tailwind will automatically generate the responsive classes (i.e. md:border-box, lg:border-box).

@responsive {
  .border-box {
    box-sizing: border-box;
  }
  .content-box {
    box-sizing: content-box;
  }
}

Hey @skollro! I would recommend creating those utilities as needed for your own project right now as we don't have plans to add them by default. Thanks!

@adamwathan any plans on revisiting this? I have a few sites where I've needed to add this manually and I feel like it should be a part of core just like userSelect or appearance are.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rgaufman picture rgaufman  路  3Comments

dbpolito picture dbpolito  路  3Comments

divdax picture divdax  路  3Comments

AlexVipond picture AlexVipond  路  3Comments

spyric picture spyric  路  3Comments