45 ms·
Play with TailwindCSS in the Browser
- fareesh 4y agoSeems like a cognitive nightmare to have this in projects. I'm not sure what problem it solves other than doing everything in one file as opposed to multiple files.
- martini333 4y agoTailwind feels so wrong. But then you try it. Never been more happy building web apps!
- annagrigoryan2 4y agoI use this a lot! Also I love the youtube channel that they have Tailwind labs, as a non-css person I appreciate how easy my life is with Tailwind.
- My90thaccount 4y ago
- config_yml 4y agoAs someone who's been doing CSS for 20 years now, I think Tailwind is an absolute blessing. They've gone a bit crazy with the latest features, but the core of it is so productive to use, especially in teams. Big fan here.
- My90thaccount 4y agoOnce again, productivity is not the ultimate goal of a profession. Your product is suffering in quality because you are taking shortcuts.
- kaba0 4y agoDo you have any basis on claiming that the product suffers in quality from using tailwind?
- config_yml 4y agoIt's not, but it's important. And contrary to what you say, using Tailwind is productive for me AND increases quality. So that's a win for my product.
- irrational 4y ago> They've gone a bit crazy with the latest features Can you elaborate? What are the latest features?
- config_yml 4y agoArbitrary Variants looks a bit crazy to me (I haven't used it yet though): https://github.com/tailwindlabs/tailwindcss/pull/8299 https://github.com/tailwindlabs/tailwindcss/pull/8299
- criswell 4y agoI know it's going to be abused to hell like everything popular but definitely a useful power tool. It'll be really nice for container queries when they're ready. Something like: `wider-than-[500px]:hover:text-red-500` and so on. Also super nice for `:has` (although ordering is a concern at the moment): `[:has(:invalid)]:bg-red-500`.
- yurishimo 4y agoI think they are referring to custom values. As a part of the move to the JIT compiler, it's possible to define arbitrary classes and have Tailwind pick up on it and create a class. Consider this. `text-red-500` is an out of the box class from TW that gives you a solid red text color. With the new JIT compiler, I can write `text-[#BADA55]` and the compiler is smart enough to generate a class with that hex code as the value for the color. You can use this syntax for almost any available class. This feature is useful for some cases (marketing sites with finicky pixel perfect requirements) but it can also be abused. It's up to your team to decide where it makes sense to break out of the design system, or if you should add that new value as a token to be reused throughout the app.
- dgb23 4y agoThat’s making a whole bunch of assumptions about professional web devs, including the people who maintain Tailwind and similar libraries. Also accessibility and HTML classes are completely orthogonal concerns.
- julianbuse 4y agoI agree that tailwind may not be the most elegant way to style a webpage, and I also prefer classes and regular css or sass, but I don't think you will convince anyone to give up tailwind with such a toxic comment. Perhaps it would just be better if you stopped ruining hn for the rest of us. Additionally, styling and accessibility are not related (unless your layout is terrible, but that is just as doable with css).
- EudaimonBlue 4y ago"People who know these things think tailwind is a travesty" Sounds like people don't like changes to things that they are used to. Overall Tailwind really does make styling cleaner.
- My90thaccount 4y agoIt makes your job easier at the expense of the quality of your product.
- jonwinstanley 4y agoHow does it affect quality?
- My90thaccount 4y agoTailwind means making your HTML non-semantic, usually backed by JavaScript. This has created an arms race where parsers such as screen readers need to do ever-evolving heuristics to provide a reader mode. The code usually cannot be modified or even viewed in a readable form by users. Of all things, it's not user-centric. You're going to tell me next that you have a JSON interface instead. But that's a site-specific API that's designed for vendor lock-in. You're going to find that doesn't work and need to create a universal format. And now you have completely recreated the problem HTML was intended to solve originally. All of this wasted effort that web Devs do doesn't come from nowhere. The people with slow browsers or accessibility needs are absorbing your productivity gains 1:1.
- jonwinstanley 4y agoPretty sure you haven’t really looked at Tailwind. It’s as semantic as you make it. And it works without JS.
- danielvaughn 4y agoI'm sorry but this doesn't make any sense at all, what on earth are you talking about? I'm all for constructive criticism, even if it's harsh, but this makes it sound like you've literally never read anything about Tailwind at all. First, Tailwind has literally no opinion on whether your html is semantic or not. Second, it isn't "backed by javascript", that's nonsense and is just self-evidently not true. Third, "people with slow browsers" benefit because the CSS footprint is smaller. Fourth, the quality of the site improves with Tailwind because developers can spend their unused energy on other enhancements. Why get on this thread and spew a bunch of bullshit? What's the point dude.
- playbooks 4y agoNext we need a TailwindCSS CSSZenGarden demo.
- jonwinstanley 4y ago...flashback to maybe 2003 and the Zen Garden blowing my mind!
- fleaaa 4y agoAm I only one that feeling like code readability is a bit gross?
- cglace 4y agoBut ergonomics are so much better. I’ve seen my team increase throughput dramatically after switching to tailwind.
- lloydatkinson 4y agoNo, there are in fact many people who do not read the docs. https://tailwindcss.com/#:~:text=Worried%20about%20duplication%3F%20Don%E2%80%99t%C2%A0be https://tailwindcss.com/#:~:text=Worried%20about%20duplicati....
- andix 4y agoUsually you build reusable components with tailwind, so that you archive DRY. With React for example (or any other technology). The huge benefit is, that you don’t split up HTML and CSS, you only write HTML.
- quickthrower2 4y agoPlain HTML yes. Using a web framework? No. It is clever in that half of it is missing: the componentisation that React (etc.) brings with it makes this shine. You can also define normal CSS classes based on the utility classes if you so wish. Tailwind after 4 hours of learning curve is so much nicer than cutting css or using old skool css frameworks. Some of that is because ready designed components exist that you can copy. With an old skool css framework once you hit an edge case you can be snookered and spend ages diagnosing why because of some clever stuff they done. Tailwind says “yeah css was a bad idea, let us abstract it away a bit” and does a nice job.
- danielvaughn 4y agoI’ve used Tailwind in quite a few projects at this point. It’s a bit gross, yeah. But overall that’s a small price to pay for all the benefits it brings.
- LordHeini 4y ago
- monkey_monkey 4y agoAlso of interest is the 'Play CDN' feature, which allows Dev Tools experimentation https://tailwindcss.com/docs/installation/play-cdn https://tailwindcss.com/docs/installation/play-cdn
- rco8786 4y agoIm sorry but I don’t understand how anyone can look at that and think it’s a good way to build UIs. I’m almost certainly in the wrong, considering how popular this library seems to be getting, but holy heck that looks like a tedious mess to work with. It’s like you have to learn every raw CSS selector, and then also learned how it’s represented in Tailwind, and then scatter that all over your markup.
- madeofpalk 4y agoI'm with you. I'm pretty into neat experimental frontend + css stuff, and I'm baffled by how passionate Tailwind's fans are. It always feels like there's something I'm missing. In all fairness, I've never actually tried it.
- danielvaughn 4y agoYou should give it a shot, but IMO what makes it worth it is the Tailwind Intellisense plugin. I can design an element in just a few keystrokes, it's amazing.
- christophilus 4y ago> In all fairness, I've never actually tried it. I was of your opinion until I tried it. Been using it for over a year on my current project, now. I recently built a little prototype without using Tailwind, and man… I didn’t realize how big a quality of life improvement Tailwind is until I stopped using it. It’s really hard to imagine going back. Edit: I’ve been building websites since 2000, and know CSS quite well, and hope to never write much CSS again.
- chrisshroba 4y agoAgreed - they even include almost at the top of their homepage [1] a quote from the creator which includes: "If you can suppress the urge to retch long enough to give it a chance, I really think you’ll wonder how you ever worked with CSS any other way." [1]: https://tailwindcss.com/ https://tailwindcss.com/
- 4y ago
- samtimalsina 4y agoI was in the camp "this-is-bullshit" until recently. It felt backwards. We recently switched to Tailwind for one of our projects, and Tailwind was a delight to use, especially with its VS Code extension. Code readability is surprisingly not that big of a deal because we use components. Of course if you are looking at the raw HTML in chrome tools, it can get disorienting. For folks that are worried about having to learn yet another "language", the learn curve is pretty short.
- danielvaughn 4y agoyep. With the VSCode extension, you don't even need to read the docs. I would just type in what I thought I wanted, and most of the time it would work. It's awesome.
- andiareso 4y agoI'm in the same boat. I laughed the first time I saw it on Hacker News and thought it was the dumbest replacement to just using style tags. Boy I felt like an idiot when I started using it. I spend way less time going from idea in my head to actual concept now. Foolish boy.
- faebi 4y agoI think part of the tailwind appeal is the top-notch integration into vscode. It made the learning experience even better for me. One of my favorite features are the large but limited color palettes in combination with states. I always found it messy to add another once-used button style to bootstrap, plus, then suddenly my button lives in multiple files. Here‘s a nice green example button, written out of my head during my holidays: rounded p-2 border text-green-800 bg-green-100 hover:bg-green-200 active:bg-green-300 border-green-200 hover:border-green-300 active:border-green-400 It‘s long but somehow it‘s easy, readable, customizable and consistent. The limitations are still there though, just think of transitions and animations. Personally, I would also be happy if inline styles wouldn‘t be with their limitations, but that entirely another topic.
- friendlypeg 4y agoIs there a VSCode plugin that help you do something like this: when I type text-20px it will try to find the closest class e.g. text-sm automatically?
- clementmas 4y agoTailwind CSS IntelliSense will give you a list of all the possible classes with the associated pixel value. You can also do text-[20px] if you really need that specific size.
- atonse 4y agoNo but when you select an intellisense suggestion, before hitting enter, it’ll show you the underlying css. That can sort of give you the same effect even if in reverse.
- criswell 4y agoIntellisense would help a lot with this task: https://gist.github.com/crswll/db0d276bbf0884b003f3715d48e68de6 https://gist.github.com/crswll/db0d276bbf0884b003f3715d48e68...
- irrational 4y agoFor someone who usually avoids divs in favor of semantic tags, that many divs makes me uncomfortable ;-) I presume the use of so many divs is a stylistic choice and not a requirement?
- jonwinstanley 4y agoYes, you can add Tailwind rules to any element, use of Semantic elements is obviously preferred but not essential
- krono 4y agoUtility classes aren't Tailwind's invention and neither are style systems/constraints. I even believe that their particular implementation is a total mess with way too much and continuous overhead, and that you're probably better off building your own system.
- grayrest 4y agoTailwind's implementation is a total mess. I have a custom preset for UnoCSS [1] focused on Tailwind compatability and use that for my company's low code platform. It's a couple orders of magnitude better for both size and latency and switching has allowed me to delete all the supporting code I'd written to work around Tailwind-the-implementation's shortcomings. I have minor complaints about Uno but I recommend it if you're having trouble with Tailwind. [1] https://github.com/unocss/unocss https://github.com/unocss/unocss If you mean build your own design system then I've built four separate design systems in SCSS since 2009. I've been fine with switching to Tailwind instead because I can get similar results customizing the theme, it's more comprehensive than my systems, and the network effect advantages of somethign popular vs my one-off thing.
- anon1378 4y agoI cannot believe how anyone can look at the following code below and think that it's maintainable, just for an input box with additional styles for states: <input type="text" value="tbone" disabled class="mt-1 block w-full px-3 py-2 bg-white border border-slate-300 rounded-md text-sm shadow-sm placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none invalid:border-pink-500 invalid:text-pink-600 focus:invalid:border-pink-500 focus:invalid:ring-pink-500" /> How is mushing every single style into a class attribute supposed to help with readability and maintainability? Even if you use `@apply` to reduce the clutter, you are basically venturing back into "vanilla" CSS territory, and which their docs expressly said to avoid (https://tailwindcss.com/docs/reusing-styles#avoiding-premature-abstraction https://tailwindcss.com/docs/reusing-styles#avoiding-prematu...). And even if I decided to march forward with tailwind CSS despite all of this, how do I format the code? Break up the classes for different states into separate lines, like so? <input type="text" value="tbone" disabled class="mt-1 block w-full px-3 py-2 bg-white border border-slate-300 rounded-md text-sm shadow-sm placeholder-slate-400 focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none invalid:border-pink-500 invalid:text-pink-600 focus:invalid:border-pink-500 focus:invalid:ring-pink-500" /> Yeah, I do not see how this is more readable than plain CSS. Is all of this worth it, just to avoid having the developer think up of class names, or defining their own theme using CSS variables?
- zachrip 4y agoI like tailwind a lot actually, but I agree with you about the readability of some classes. It'd be cool if the vscode extension helped with that in some way.
- mattferderer 4y ago> Is all of this worth it, just to avoid having the developer think up of class names, or defining their own theme using CSS variables? Yes. You're starting out with a well thought out set of variables & themes. You can tweak if you need. You can add extensions. There are lots of HTML/CSS components written for Tailwind online you can copy/pasta into your project. But for me the biggest win is just having a ton of variables I can use. I also only use it when building component type architecture & I try to keep my components small & focused.
- halotrope 4y agoThere is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I know it is conceptually "wrong" and a bunch of well crafted CSS classes would be more elegant. In the end it works, works really well and makes collaboration dead simple. Commonly used groups of classes can either be aliased by @apply or used in a (react) component. I used CSS way before Tailwind was a thing and in hindsight I created a lot of utility classes that resembled a weakly-structured, somewhat incomplete version of Tailwind. It might be a bit verbose, it might be easy to abuse but it works damn well. On top of that there are some design guardrails built in that really help with the consistency of e.g spacing, colors and fonts. Easy to achieve good looking results without risking stuff always looking the same like with Bootstrap or Material. It is a bit like Github Copilot. The only way to "get" it is to try it.
- kanonieer 4y ago> There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I know a lot of people who have tried but didn't like Tailwind. I think most people like it on a greenfield project, but that number drops off when they go back to a Tailwind project after some time.
- andiareso 4y agoMeh everyone ultimately has a personal preference so it's a bit hyperbole to say that everyone that hasn't used it would like it. Just like everything, it would depend on the project, team, and individual. I personally was against it until I used it.
- hbn 4y agoTailwind projects are the only ones I've hopped into for my first time (i.e. never seen the codebase before) and I can immediately be productive cause I don't have to wrap my head around one specific person's ideas of how classes should work and what all the names mean. Same applies for my own code that I come back to after a year or 2 of not having touched it. It's way easier to parse a template that declares its own styling than a template with references to style classes that may be across multiple CSS/SCSS files and are probably badly named
- ChrisArchitect 4y agoSomething new here? Why submit this? Been part of the docs/demo page for years.
- dandep 4y agostarted using tailwind when I hadn’t mastered css and it actually speeded up my learning, because: - faster iteration and experimenting - tw docs are great learning material too - tw classes are made by experts so you can indirectly learn what are best practices
- 65 4y agoI used to be a Tailwind hater. I couldn't fathom why anyone would ever use it. And then I used it. It seriously makes CSS significantly easier to maintain, dramatically reduces your CSS build size, and is really good for teams if you're trying to use consistent CSS throughout your UIs. You also don't need to go back and forth between CSS file and HTML file. If you're on the fence, try it out. I think it's the future of writing CSS.
- anthonylee 4y agoI tried it out last year. Absolutely love it.
- deleted 4y ago[deleted]
- mritchie712 4y agofor haters, color management is a good starting example of why it's good. https://tailwindcss.com/docs/customizing-colors https://tailwindcss.com/docs/customizing-colors
- lolinder 4y agoColor management is easy in SCSS, too, though. I just have a _colors.scss file and enforce that no color is ever used that isn't in that file. If I'm working with a designer rather than designing my own UIs, that they have a default color palette isn't helpful, so what do I gain from Tailwind? EDIT: Reading some other comments, I wonder if part of the reason I don't see the utility is that I use Vue, not React. It sounds like Tailwind solves a lot of the same problems that Vue+SCSS does.
- bpicolo 4y agoOne good part is the generated classes for every color. Background colors, font colors, border colors... everything in the color palette is usable as `bg-blue-500`, `text-blue-500`, `border-blue-500` etc. Could be reproduced in css for sure, but it's a great set of defaults that you can utilize cross-repo. Standardization is a powerful concept.
- remorses 4y agoIt would be nice if we started adding more css features to inline styles seeing the success tailwind css has. The only reason I use tailwind is that I can keep styles close to markup, I would just use inline styles if they had access to media queries and pseudo selectors
- k__ 4y agoI like the Tailwind approach, but I still start projects with Bootstrap, because it comes with a nicer out-of-the-box experience. Also, it seems to me that Bootstrap started following the utility-classes approach more and more over the years (px-1, flex-column, etc.) Bootswatch themes are nice too.
- samwillis 4y agoHaving used bootstrap 5 on project, I love the new utility classes. Find myself using them all the time, having been sceptical of that style of css I’m a compleat convert. I think BS 5 is a nice middle ground between the older BS and Tailwind.
- k__ 4y agoYes. BS5 is pretty nice, but it could be smaller, haha.
- jordanmorgan10 4y agoFun Tailwind play story: I developed nearly my entire site using it. All the IDEs were simply slower. With Tailwind’s component based approach, it was no problem to develop each part in isolation and plug it in once it looked good on their playground.
- abhayhegde 4y agoAs a self-taught web developer, Tailwind has been a breeze to use, especially since I can play with default properties that already fit in nicely. Gives so much customizability. However, I do find it laborious some times, since I have to define properties for each div every time, instead of just selecting things by CSS classes. Or I am doing this wrong.
- lloydatkinson 4y agoYou are in fact doing things very wrong. You’re supposed to be creating components or view partials or whatever you framework calls them and use those. The homepage literally has examples of doing this with multiple frameworks.
- abhayhegde 4y agoOh yes! I had not seen that. A component template would be so useful for me! Well, that is how one self-learns I guess: through mistakes.
- jbaczuk 4y agoI've found Tailwind to be great for getting a project going quickly. It's pleasant to use when you get started, but it can become a pain later on when you have a lot of styles to maintain. I've been using it everyday at work for a year and a half, and wished I would have known a few things before I started using it. Here are a few: 1 - It encourages styling on the fly. Because it is faster initially, you don't have to constantly switch between a CSS file and your markup, it feels good to style it as you go, and gives you an initial productivity boost. But it can cost you in technical debt later, so be careful. 2 - It makes your markup really messy. You end up repeating the same utility classes over and over. Then you can forget which utility class you used for things that should be defined globally like spacing or colors, and have components with different styles and not one place where you can change it. 3 - It makes debugging styles in the browser difficult (you change the style of one class, it affects everything, not just the tag/component you are working on. Having component-based classes allows you to debug styling on individual components much easier. I find myself debugging by actually adding the utility classes to the markup. 4 - You have to memorize another name for every many css properties (e.g. line-height => leading), or just be constantly in the docs. VSCode extensions are helpful, but it does not always detect that you are trying to type a Tailwind class, esp. if it's dynamically generated classnames. It can also make VSCode run slower. 5 - Some CSS properties are missing values as options, so you have to customize it out of the gate (e.g. min-height) or use the custom m-h-[value] syntax, but why not make all of tailwind like this? 6 - Trying to sync Tailwind configurations between projects (e.g. between a component library and an application) can become tedious. Like anything, I think good styling is probably a combination of global styles, utility classes, and component classes. Something like Tailwind + Bootstrap + SASS on top of your own custom classes might make for a good tool, IMO.
- jozzy-james 4y ago1. Being able to run a dev build (with no PurgeCSS) and use the .cls area of dev tools to quickly throw together TW classes to get stuff sorted, then carry over to the final resting place is wonderful. Compared to manually typing each property and value on the element and then copypasta'ing from there. 2. If you need to use the same group of utility classes over and over, extract to a class - either with @apply (if you want to keep the flexibility of config updates) or vanilla. 3. I'm not sure I'm following here - if you're changing the value of a tailwind class, you should do that via the config 4. I've found the naming differences easy enough to follow - line-height vs leading makes sense if you come from a design background. I think the biggest gotcha I had early on was everything is mobile first by default - so sm:* is actually _larger_ than the default. 5. the JIT is a wonderful addition, but does come with overhead currently - so that's why it (i assume) isn't just the default way of doing things. 6. not a problem i've run across, but why would a component config supersede an app config? to your last point, we use tailwind in conjunction with a fair amount of legacy sass to do what we need (many small nuances, spread across 4 different sites, that are otherwise the same) - I would urge against mixing tailwind and SASS if only for the build speed, PostCSS should be able to do everything you need there and it'll just make the builds a bit faster. tho I feel like what myself and my team works on is a far cry from your standard HN web app - so my experiences are probably very different.
- baryphonic 4y agoI just learned tailwind a couple weeks ago for a small project. I really love it—I've gone from being a CSS hater to not having to think much about CSS. The documentation is excellent, with working examples. It has taught me about CSS properties I didn't know existed. Instead of attempting to grok the entirety of the MDN docs, I can quickly use configurations that work. (The ubiquitous Seinfeld references are an enjoyable treat, too, though YMMV.) The other important piece is that the tooling is great. I use the VS Code extension, and beyond the excellent intellisense, the extension gives me exactly which properties and values are generated by the Tailwind classes when I mouseover. The only "complaint" I have is that sometimes in larger projects, I'd want to create reusable style components (almost like traits) that could be reused in components that appear similar but whose behavior is distinct. This is a minor complaint because Tailwind actually allows for this, but the syntax is slightly awkward. In all, I'm much more productive, and I imagine my code is more maintainable. It's certainly smaller without dozens of lines of CSS including the commented out sections.
- xkcd1963 4y agoI tried it out for a project and I regret it. Following reasoning: - CSS was created so no inline styling would be necessary. By assigning CSS attributes to classes we are back at inline styling. The html just explodes if you don't put the tailwind classes somewhere else, but then again, CSS is already here for that - one wastes time learning new naming conventions. Most frontend developers have internalised CSS attributes - it runs through a javascript lib. That makes the setup more complicated. Browsers support CSS natively so why build something on top of that
- tomtheelder 4y agoI think there's a chance that you're using it in a project it isn't suited to. For your first reason, component driven applications provide a compelling reason to go "back" to inline styling. You already have your abstraction, and adding another one (cascading styles) does you no favors. It just creates two interleaving re-usability schemes that are a nightmare to maintain in parallel. This is the same reason that component-local CSS has become very popular. Second one is a reasonable enough criticism. Never bothered me, but I think it's fair. Third: it's really designed for bundled, JS-based, component driven applications. In that context it's a breeze to set up, and really no more difficult than native CSS. By the way, the reason they do that is so it can do some clever things like removing the utility classes from the CSS that you actually ship to reduce payload size. There's no reason that you can't just build the entirety of Tailwind and just ship that as your CSS.
- jozzy-james 4y agoit isn't really _designed_ for JS based applications, but if you're not at least running vite/webpack/etc with PurgeCSS then your builds will be rather bloated and you lose out on customizing the settings - if you really just don't care, then you can run the default CDN build
- gpspake 4y agoI describe tailwind to people as a lightweight, classname-based abstraction over vanilla css rules. Unlike bootstrap where the button classname represents a collection of inherently opinionated and obfuscated css rules, the classnames map directly to the rules themselves - without any obfuscation behind a button class or opinions about what a button is. You can look at a tailwind classname and understand exactly what css rule is being applied. It's universally repulsive at first sight. Everyone who loves tailwind said "hell no" - but they pushed through it and ultimately understood the value in it. The reason that Bootstrap can't continue to exist as it does currently is because our js implementations have taken center stage and bootstrap requires a js implementation for many of its components. This means to use bootstrap with react for instance, you need a third party lib like reactstrap. Tailwind is JS agnostic and frees you up to use the react (ng, vue, etc) ecosystem's idiomatic implementations for things like tooltips without adopting an entire bootstrap abstraction like reactstrap. Any respectable UI lib will allow you to pass classnames as props. You just pass in some tailwind classes as props and call it a day. If your initial reaction is "this is ugly" I encourage you to dig deeper. Imagine never having to think of a name for a css class or context switch in to a 400 line css file to figure out what button means. I like tailwind :)
- pupppet 4y agoEvery time I see TailwindCSS code I feel like the world has gone crazy or I've just got too old.
- jozzy-james 4y agoor you might just be working on stuff where the abstractions don't provide a lot of benefit.
- no_wizard 4y agoThis is awesome. I did see this dropped right alongside Tailwind V3, or there abouts. One thing I wish Tailwind did with production builds is take all those CSS classes and run them through a css-modules transpiler. If they can detect the names in the files, can't they also use the same lexer to do replacements on the code too? That would be the ultimate efficiency, in terms of bytes saved.
- vsroy 4y agoPeople here are complaining about how Tailwind is annoying because the className strings are too long. The correct solution is to write a quick 1-file helper. See: https://gist.github.com/vedantroy/80fb2feb21b07b6f53032b87254c537e https://gist.github.com/vedantroy/80fb2feb21b07b6f53032b8725... I wrote that. It allows me to do stuff like: const Button = tw.div(` bg-blue-500 rounded `) Any complaint about how tailwind forces overly long class names should probably look at this comment first.
- deergomoo 4y agoI’m not sure if JSX supports it but Vue templates and of course just regular old HTML allows a class to span multiple lines anyway. It doesn’t all have to be on one huge line.
- apineda 4y agoI would recommend open props over tailwind. No special tooling, no JIT complexity, just straight up css variables / json tokens. You're also not stuck littering your markup with tailwind classes later that can become difficult to track down if you ever do want to refactor / change methods.
- jozzy-james 4y agocool, not sure how that works in PHP tho
- ttty 4y agoTailwind is to styled components .... Like jQuery is to react. Popular now, huge pile of mess in a few years.
- boringuser1 4y ago
- boringuser1 4y ago
- junon 4y agoI've never seen tailwind until today since I've never felt the need to use a framework. After seeing this example, I certainly never will.