TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Open-sourcing our progress on Tailwind CSS v4.0

190 pointsby ssernikkabout 1 year ago

19 comments

kingofthehill98about 1 year ago
Tailwind is the second best thing ever happend to frontend, only Vue 3 tops it.<p>Not having to come up with names for CSS classes, no duplicated CSS code, no fighting conflicting classes, everything in one file, being able to visualize a component just by reading the code... it&#x27;s a godsend. I&#x27;ll never go back to SCSS unless work obliges me.<p>Vue 3 with &lt;script setup lang=&quot;ts&quot;&gt;, TailwindCSS and Vite. The way God intended.
评论 #39619565 未加载
评论 #39619599 未加载
评论 #39618732 未加载
评论 #39618545 未加载
评论 #39622333 未加载
评论 #39618793 未加载
评论 #39618602 未加载
评论 #39618806 未加载
评论 #39619994 未加载
jaredcwhiteabout 1 year ago
As a forceful critic of Tailwind over many years now, I must say all of the announcements under the CSS-first configuration are extremely welcome. This makes it possible to take advantage of all of Tailwind&#x27;s design tokens, reset, etc.—and even even customize them via real CSS—and then use tokens in honest-to-goodness CSS via native variables. This opens up a new world of &quot;light&quot; usage of Tailwind for its theming and utilities, *without* throwing away all of the awesomeness of modern CSS architecture, the cascade, and even shadow DOM in web components.<p>I&#x27;m a huge fan of this major improvement to the framework.
mgabout 1 year ago
CTRL+u gives a nice example of the syntax.<p>For example to make a box with rounded corners and a top and bottom section, all you need is this intuitive one-liner:<p>&lt;div class=&quot;mt-5 mb-8 first:mt-0 last:mb-0 relative overflow-hidden rounded-2xl&quot;&gt;&lt;div class=&quot;pt-2 bg-slate-800 shadow-lg group&quot;&gt;&lt;div class=&quot;flex text-slate-400 text-xs leading-6&quot;&gt;&lt;div class=&quot;flex-none text-sky-300 border-t border-b border-t-transparent border-b-sky-300 px-4 py-1 flex items-center&quot;&gt;app.css&lt;&#x2F;div&gt;&lt;div class=&quot;flex-auto flex items-center bg-slate-700&#x2F;50 border border-slate-500&#x2F;30 rounded-tl&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;children:my-0 children:!shadow-none children:bg-transparent&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@import&lt;&#x2F;span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;tailwindcss&quot;&lt;&#x2F;span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;pointer-events-none absolute inset-0 rounded-2xl dark:ring-1 dark:ring-white&#x2F;10 dark:ring-inset&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
评论 #39618781 未加载
评论 #39618738 未加载
评论 #39618524 未加载
评论 #39618531 未加载
评论 #39618607 未加载
评论 #39618511 未加载
评论 #39618962 未加载
评论 #39618635 未加载
评论 #39620430 未加载
acaloiarabout 1 year ago
&gt; Standalone CLI — we haven’t worked on a standalone CLI for the new engine yet, but will absolutely have it before the v4.0 release.<p>This part is the most exciting to me. Given the rest of the release announcement, I&#x27;m assuming this means that it&#x27;ll be built in Rust rather than embed Node. While I&#x27;m not a Rust zealot of anything, I&#x27;m very partial to not embedding Node. Particularly when it depends on using Vercel&#x27;s now-abandoned pkg[1] tool.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;vercel&#x2F;pkg">https:&#x2F;&#x2F;github.com&#x2F;vercel&#x2F;pkg</a>
评论 #39618977 未加载
评论 #39619791 未加载
ado__devabout 1 year ago
Lots of promising improvements. I&#x27;m most excited about being able to control the theme via CSS instead of having to extend via JS.
评论 #39618837 未加载
hit8runabout 1 year ago
My friends: do we need tailwind as soon as Safari 17.4 is out? Chrome has @scope already available and safari soon. With @scope we don’t need utility frameworks at all and can make use of scoped css with css variables for unification. What do you think?
评论 #39619838 未加载
评论 #39619393 未加载
asimpletuneabout 1 year ago
I am not a front end developer, but I do maintain a few websites and I have used Tailwind for all of them.<p>My general take of the overall quality is that the maintainers of Tailwind have really good intuition in terms of what to prioritize, as well as excellent design taste. Tailwind is one of those tools where it only makes sense once you start to use it, but each version they&#x27;ve announced brings a continuously more polished product.<p>If you don&#x27;t like Tailwind or you don&#x27;t understand it or if anything I&#x27;m saying makes you mad, try first building something big with it. It&#x27;s pretty maintainable, easy to read and write, and, most of all, is very portable. (I mean that in the sense that something you write in one place can be copy and pasted somewhere else and it will more than likely work exactly the same.)<p>As far as this version is concerned, it looks like not a whole lot has changed from a compatibility perspective, but I think when version 4 becomes official it might have more breaking changes. In any case, the prospect of a new engine is very cool, as faster builds are always welcome.<p>Congratulations to the team! I may not be a front end engineer, but with Tailwind I don&#x27;t really have to be to make what I want.
评论 #39629475 未加载
corytheboydabout 1 year ago
Out of curiosity, does anyone out there use tailwindcss with htmx (or other hateoas approach)? You obviously don’t want to have your hypertext representative of application state to have anything to do with styling, but something like tailwind can be odds with that. Cascading style sheets and hateoas obviously go together perfectly, as it’s markup and styling decoupled as god intended, but with something like tailwindcss, what are people doing?
评论 #39621627 未加载
评论 #39634464 未加载
sathl0neabout 1 year ago
I use Tailwind at work daily and I still believe it is a crutch for a bad design system. I see pros and cons. If you keep your class count relatively small, you can &quot;see&quot; how the element is going to look if you are good with CSS, and it is incredibly intuitive. On the other hand, when you see blocks with 20+ classes, just like some examples posted here, they are hideous and all the readability goes down the drain, I take this should be made up for with the use of components and limiting copy pasting. Also I don&#x27;t think you have to use either Tailwind or more classical approaches, in fact I like mixing both. During a rush a couple of years ago my team had to give a more up to date look to mane features in our app and, provided you have a strong component system, those touch ups were mostly related to positioning and sizing, and that represents 99% of our usage of Tailwind.
djmashko2about 1 year ago
Looks like a lot of great improvements, but wanted to put in one vote in favor of keeping the capability of having a JavaScript-forward configuration&#x2F;usage approach, rather than requiring a CSS-forward approach.<p>For us, one big benefit of using Tailwind has been that we can avoid spending a lot of time thinking about CSS and CSS tooling, and being able to configure everything via JS has helped in that regard.
评论 #39619298 未加载
评论 #39619914 未加载
akvadrakoabout 1 year ago
I wish tailwind would support attributify like <a href="https:&#x2F;&#x2F;github.com&#x2F;unocss&#x2F;unocss">https:&#x2F;&#x2F;github.com&#x2F;unocss&#x2F;unocss</a>, which is much more readable for complex layouts:<p><pre><code> &lt;a bg=&quot;red&quot; text=&quot;white&quot; dark=&quot;bg:red text:white&quot;&gt;link&lt;&#x2F;a&gt;</code></pre>
sntranabout 1 year ago
I was excited to use this in my Demo project, but `import from &quot;node:@tailwindcss&#x2F;postcss@latest&quot;` throws error about the `exports` field in package.json.<p>With that aside, the blog post mentions not having to use `postcss-import` but it seems to include that as dependency. So we&#x27;re still using `postcss-import`.
tomschwihaabout 1 year ago
Is there any good tutorial&#x2F; guide available with best practices for tailwind?
评论 #39618649 未加载
评论 #39618593 未加载
评论 #39618643 未加载
评论 #39618940 未加载
radoabout 1 year ago
If an org can&#x27;t organise its workflow (name things) and adopt external organisation (magic bullet frameworks), the org will always have poor organisation in the long term.
评论 #39620939 未加载
TIPSIOabout 1 year ago
Switching the theme configuration to CSS variables makes a ton of sense.<p>But what is the point of introducing a directive called &quot;@theme{}&quot; though for configuration?<p>Why not just do &quot;:root{}&quot;?
评论 #39619792 未加载
评论 #39619172 未加载
morbicerabout 1 year ago
How does people solve component variants? Say &lt;Button type=&quot;success&quot; size=&quot;lg&quot;&gt; or &lt;Button type=&quot;danger&quot; size=&quot;sm&quot;&gt; ?<p>For optimal gzipping (and saner readability) it&#x27;s recommended to have sorted classes (prettier-plugin-tailwindcss)<p>But if you want to have some overridability (avoid clashing of p-4 and p-8) you need tailwind-merge.<p>These two don&#x27;t play together well
评论 #39619436 未加载
评论 #39619318 未加载
YetAnotherNickabout 1 year ago
This is not a complaint. But as someone who uses AI heavily for tailwind, I found that GPT-4 couldn&#x27;t update the syntax even after the cutoff is updated. Likely it gives equal weightage to documents regardless of the date. And even with 2023 cutoff it just can&#x27;t work with new syntax of many libraries I tried.<p>I had hopes with google in this as they already likely have things like official docs, updation etc labelled so they can give different weights to every document. But then there is Gemini.
评论 #39619123 未加载
moralestapiaabout 1 year ago
&gt;Last summer at Tailwind Connect ...<p>Wow, a CSS library with a developer event and Apple style keynotes.
评论 #39625260 未加载
stevageabout 1 year ago
Everything about this sounds like how I expected Tailwind to work the first time I tried it.<p>I wanted to love it, but instead got bogged down in all this PostCSS nonsense and configuration before I could do anything.<p>Happy to see they&#x27;re moving towards a &quot;it just works out of the box&quot; approach.