Comments (9)
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.
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.
Not much of a story, just haven't had the chance to do it 🤷
from twin.macro.
Ah okay, no worries then. Just seemed weird that single class didn't work. Was just curious.
from twin.macro.
Decided to finally add support for
container
, it will be in the next version.
I'm also adding acontainer-auto
class to automatically centre the container instead of having to addmx-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.
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.
Awesome! Dunno about adding any new classes though. Bit of a smell.
from twin.macro.
I don't see it the same way, there's zero filesize added to your app until you use it
from twin.macro.
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)
- `group-x` classes containing `/` aren't working correctly
- Support for @headlessui/tailwindcss prefixes in inner classes HOT 2
- the name `_GlobalStyles` is defined multiple times HOT 1
- Unable to clone and style existing components with Stitches using standard syntax HOT 3
- Doesn't work with CodeSandbox React template HOT 1
- Error when passing props to the css attribute in solid/stitches HOT 3
- CSS `calc` with more than 2 `theme` keywords HOT 1
- Can't resolve 'v8' (Twin + Next.js + Styled Components) HOT 9
- Twin Macro Doesn't Work With Next.js (A Working Example Would Solve This) HOT 6
- Dynamic is not working as expected in next-emotion-typescript HOT 2
- Module not found: Can't resolve 'v8' HOT 3
- Property 'cs' is missing in type.... HOT 2
- Next 14 layout shift (maybe css load after render) HOT 2
- Jest testing (typescript) - twin_macro_1.theme is not a function HOT 2
- Errors in vite 5.0.0 HOT 1
- TypeScript type error with TwImportComponent in jest-testing-typescript
- CSS fallback values from Tailwind config `extend` are missing HOT 2
- Props don't get passed down when composing components HOT 5
- Custom Tailwind Properties in Twin.macro not working HOT 1
- Storybook v8 not working in combination with Styled Components and twin.macro HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twin.macro.