Giter VIP home page Giter VIP logo

Comments (9)

ben-rogerson avatar ben-rogerson commented on May 18, 2024 3

Decided to finally add support for container, it will be in the next version.
I'm also adding a container-auto class to automatically centre the container instead of having to add mx-auto.

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024 2

I think we just need to generate a js object of this from screens in config:

.container {
  width: 100%
}

@media (min-width: 640px) {
  .container {
    max-width: 640px
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px
  }
}

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024

Not much of a story, just haven't had the chance to do it 🤷

from twin.macro.

corysimmons avatar corysimmons commented on May 18, 2024

Ah okay, no worries then. Just seemed weird that single class didn't work. Was just curious.

from twin.macro.

patrikarvidsson avatar patrikarvidsson commented on May 18, 2024

Decided to finally add support for container, it will be in the next version.
I'm also adding a container-auto class to automatically centre the container instead of having to add mx-auto.

It is possible to override this in the tailwind configuration file, in case you missed it in the documentation: https://tailwindcss.com/docs/container/#customizing

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024

I did notice that, and that'll be supported too!
That configurable one adds padding. The mx-auto adds margins. Easy to confuse the two 👍

from twin.macro.

corysimmons avatar corysimmons commented on May 18, 2024

Awesome! Dunno about adding any new classes though. Bit of a smell.

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024

I don't see it the same way, there's zero filesize added to your app until you use it

from twin.macro.

corysimmons avatar corysimmons commented on May 18, 2024

Yeah I'm not worried about filesize—and I'm being nitpicky so feel free to ignore this—but when you add your own classes to a pre-existing lib, you add unpredictable stuff to it.

Example scenario: Someone knows Tailwind really well. They go to create a custom container-auto class like they always have, and maybe this class does different stuff than the one in twin.macro... Now they have a bug in their app and it's tricky to figure out because twin.macro was only supposed to extend Tailwind.

I'm being dogmatic, and I know how annoying I'm being, but it is a smell that all lib maintainers should try to avoid.

If you want to add your own utility classes/helpers/etc then create a lib with just that focus. That's exactly what Tailwind plugins are for.

I know container-auto isn't really going to hurt anyone, but figured I'd offer some unsolicited advice.

from twin.macro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.