Show HN: LangCSS – An AI Assistant for Tailwind

langcss.com

108 points by langcss 10 days ago

Hi All

This is my personal project that is an IDE and AI assistant for creating tailwind components and pages. You can chat to create designs, then make small edits yourself, and continue chatting to refine them. I am always working to improve the UX.

I have a time limited demo page here: https://langcss.com/demo

Please let me know what you think! Feedback is welcome.

Tech wise, this just uses NextJS (Hosted on Docker) and Azure Open AI.

skilled 10 days ago

This is a lot slower to use than simply copying components from a pre-built UI library and making your own changes, or giving syntax to ChatGPT and asking for edits. You wouldn’t use Tailwind and any of its surrounding products unless you knew the syntax and what it does.

And the pricing is outrageous, this is more expensive than subscribing to ChatGPT, with not much benefit other than a visual preview that can be accomplished with copy/paste.

  • langcss 10 days ago

    Thanks for the feedback.

    > This is a lot slower to use than simply copying components from a pre-built UI library and making your own changes

    Correct. This is something I am aware of, and next steps would be to make it easier to search and add free (open source) components to build up the UI. In retrospect I probably should have started with that, and then AI'd it.

    > You wouldn’t use Tailwind and any of its surrounding products unless you knew the syntax and what it does.

    This is true, but often as a Tailwind user I am stumpted on "how to create the thing in my mind". A good example is gradient text, but where the bottom of a letter like g is not cropped.

    > And the pricing is outrageous, this is more expensive than subscribing to ChatGPT, with not much benefit other than a visual preview that can be accomplished with copy/paste.

    It might be. The $30/m price for an ChatGPT wrapper has to have very good fit for someone, and I am probably not there yet.

    • salomonk_mur 10 days ago

      30 USD per month is extremely expensive for most web services in general.

ccleve 10 days ago

The designs don't look great.

Here's an idea: produce designs that use the commercial Tailwind components. Your designs will look great. Have a link for the user to buy the components if they don't already own them. Work out an affiliate deal with Tailwind Labs. You can get rid of the time limits and the pricing.

If you start generating money for them they may buy your app.

  • simple10 10 days ago

    Yes, agreed. Modifying the tool to use other tailwind based UI frameworks would be useful. I'd pay for a fast tool that lets me describe an app UI or landing page concept and then shows me previews rendered in different frameworks, themes, and layouts. Most of my time wasted on frontend projects is fidgeting with initial layouts and themes. If I want to switch a tailwind theme from say square to rounded corners on all the components and cards, it's a pain unless I override the helper classes. So an AI tool for theming would be worth it IMO.

    • langcss 10 days ago

      I agree with both of you, this would be a next step. Hopefully enough to salvage this a bit.

  • gigatree 8 days ago

    From what I’ve seen, Tailwind Labs isn’t a fan of collaborating with other companies - no knock on them just seems like they don’t feel the need to

keepamovin 10 days ago

Isn't the point of a library like tailwind that you don't need an AI assistant??? Sorry for the ghlibbesh comment but if you're summoning AI then why use tailwind? Just use regular.

  • chrisandchris 10 days ago

    Well, the last guy I've seen to use tailwand applied 15+ CSS classes to a div for styling. I don't know how he did it without AI, as the applied classes were not describing in any way IMHO.

    probably AI solves that for you, by generating another 50 classes and applying even more to your n levels of nested divs.

    • digging 10 days ago

      Surely I'm not the only one who finds tailwind insanely easy to use, but I see so many people bashing it every day it baffles me.

      Who cares if a div has 15 classes? When writing React, I spend pretty minimal effort creating, debugging, or modifying TW classes, especially when using `classNames` so I can break them into logical chunks. The hardest part is... oh, I get it.

      The hardest part is when other people do a shit job of organizing their classes and I have to dig through them. But an LLM isn't going to solve that problem, only an actual, intelligent algorithm to standardize class arrangement would help, like prettier for tailwind classes.

      • satvikpendem 10 days ago

        > Surely I'm not the only one who finds tailwind insanely easy to use

        It's a write-only DSL for CSS, easy to write but hard to then read and edit afterwards, which is a problem that you're blaming on a skill issue while it's a problem inherent to Tailwind's philosophy itself. Just use CSS Modules at that point.

        • mcpar-land 10 days ago

          I never understood this sentiment. Once you get past a dozen or two dozen classes being used all over your codebase, CSS becomes the write-only language to me. I don't know where this class is being used, so I won't edit it. With tailwind, I can see every style and I know exactly where it's going to be applied (to the element it's on). I find it much easier to read.

          • digging 10 days ago

            For sure, but they're talking about CSS modules, where styles are isolated to components at build time.

            CSS modules are critical in a large web app for those rare styles you can't accomplish with Tailwind, but for the vast majority of styles I do not want to be hand-writing them. Plus, unless you're extremely strict about using CSS modules, you don't escape the horror of styles being inherited from global classes - on the other hand, a robust library of utility classes like Tailwind makes "inline" styling so easy you're likely to end up with almost no hand-written CSS anywhere.

        • digging 9 days ago

          > blaming on a skill issue

          No I'm not, I'm blaming it on the lack of organizational framework. I expect people to leave a mess if there's no guideline; there are more ways to do a thing wrong than to do it right.

          > hard to then read and edit afterwards

          No, that's what I'm saying. It's quite easy to read and edit - when organized. Maybe I'm the first person to invent conceptual organization of utility classes?? In which case I ought to just make a plugin for it.

          Also, Tailwind has first-class support for grouping utility classes, such that `.button` can apply 15 different styles at once if that's your preference. So, you know, the exact same as regular CSS.

      • otherme123 10 days ago

        I tried, but it's not for me. I found myself proud of styling a button, before noticing that I spent an hour. A lot of classes are almost plain Css attributes, so you just ask yourself "why am I doing this instead of writting the Css myself, like in the old days?" It's a tell that people is making money by creating a new Bootstrap on top of Tailwind, and calling it "components". Or AI assistants.

        That said, if you enjoy Tailwind, good for you!

      • thr33 10 days ago

        (seemingly few) People bash it because its just writing regular css but objectively worse and incorrect.

        if you can write tw you can write css. if you can write css theres no valid reason to write tw.

        • digging 9 days ago

          Huh, all of those statements are incorrect.

      • timeon 10 days ago

        > Who cares if a div has 15 classes?

        Even if bottleneck are images, I still care about bloat on mobile internet.

    • victorbjorklund 10 days ago

      It isnt harder than applying one class where you set 15 different things. Only difference is you dont need to spend time naming stuff and you dont need to click to another file to see the styling applied.

      • mcluck 10 days ago

        There's a massive pile of options for writing styles in the same file as the JS. Naming stuff isn't hard when you use CSS modules. Learning and memorizing the Tailwind DSL takes just as much time as it takes to learn basic CSS.

        Do what you want but I honestly don't understand why anyone who already knows how to write CSS would use Tailwind

    • ametrau 10 days ago

      Phew, so glad we’re not using stylesheets.

  • langcss 10 days ago

    Mainly if you use Tailwind already, and need help making designs or components. As to why use Tailwind... well that is a big topic. But my favourite thing is easy tweaking of a specific component or page without affecting things globally, making those tweaks in the same place as the definitions of the tags for a component, and being able to copy ideas from elsewhere and have them appear as-is without getting "styled" by other things in the CSS bundle (or browser defaults).

  • jdjfjtjt 10 days ago

    One of the things that makes LLMs challenging to use with codebases is needing to pull in context from a large amount of different files and make edits across multiple files. Because an LLM will likely already know tailwind, you can just pass in the full text of the one component to alter without needing to also pass in one or more css/scss files as well.

sanitycheck 10 days ago

All I'll say is that the I understand completely why the demo is time limited, however it took about 2.5 minutes to fully respond to my first instruction, though it did write some code eventually. There was no time left to see how well it could refine/fix what it had created.

I'm not in the market for this (not convinced by Tailwind or by the AI assisted coding, yet) but people who are may need more than a few minutes to properly judge it.

  • langcss 10 days ago

    I see this comment alot, I have upped it to 20 minutes to err on the side of caution. Deploying now...

LauraMedia 10 days ago

I tried it out, asking it to create a button and a tabbar, modern styled. After 4 minutes, it came back with just the tabbar, that was unstyled.

Not the best demo, to be honest.

  • jgalt212 10 days ago

    so many AI tools give me this experience. it makes me wonder if any AI hype men or bulls have actually used any of the tools in this space.

    • JTyQZSnP3cQGa8B 10 days ago

      Around me, most people who drank the AI kool-aid are "ideas guys" who have never wrote a single line of code, or junior-level coders who believe I paste code from StackOverflow all day long.

      In a 8 hours day of work, I must write code at most for 2 or 3 hours, and any AI would certainly not help me unless it can understand the meaning and intention of weird C++ code. We're relatively safe for the moment.

bschmidt1 10 days ago

I said "Make a cool game" and it replied with

  Creating a full game is a bit beyond the scope of what we can do here, 
  especially since games typically require a lot of JavaScript and game 
  logic, not just UI design. However, I can help you design a cool game UI 
  using TailwindCSS! For example, we can create a simple game landing page 
  that includes a hero section, game features, and a footer. Let's start 
  with a basic layout: working on code, 822 characters...
Understandable, but it didn't let me confirm, it just started building a landing page even though I asked for a game.

I never got to see the end result, my demo seconds ran out before it finished making it and the pricing overlay appeared.

However, I realized you can just Inspect Element and delete the pricing overlay and use the product as much as you want haha. So the second time around I said "design a basic landing page" and after several minutes it rendered what looks like a very stripped down default page with an image at the top and text sections with a copyright of 2023.

Feedback: IMO it should not be a 5 minute timer, but just limit them to ~3 generations. And should move the validation to the backend, so people can't just delete the overlay and use the service for free (I could Block Element in AdBlocker and never see it again). Beyond that I would just iterate on quality.

Thanks for sharing, it could be very good if it was faster and had a little higher quality outputs.

TIPSIO 10 days ago

I predict we still have a few years left before someone totally figures out AI and web UI.

Tailwind will be a no brainer for it since it's all one line and would still be readable/tweakable to the user.

Candidly, producing components from scratch like this, I just haven't seen anyone do a great job.

Now, rewriting, tweaking, and plugging in content? Really good at modifying if you can get it to be fast.

langcss 10 days ago

Just a note for anyone else doing something like this. I think uptime/ops has been rather successful for a HN post with 89 points / 117 comments.

The costs of this post were $35 for OpenAI tokens. No one has reported any slowness or downtime.

I am just hosting on the $5/m DO (Digital Ocean) app plaform. CPU spiked at 8% at the highest. Pages are served from the CDN that DO takes care of and the API backend (which doesn't use a CDN) is mostly node forwarding on requests to Azure.

I didn't get analytics (I don't care, comments are more useful) in so can't say how many visitors. But CDN reports say 12000 requests per minute was the peak. Which probably includes all images and so on. So maybe 600 page loads per minute as a guess.

I said in the post "Docker". That is probably true under the hood! But I meant to say "Digitial Ocean".

firebaze 10 days ago

* Navigate to openai.com

* Create new account (API)

* Deposit a small amount of money

* Click "Assistants"

* Create a new one, based on GPT-3.5 or GPT-4-turbo if you want to spend a few cents instead of millicents

* Enter "You are an expert Tailwind CSS developer and you fulfill the requests presented to you to the best of your knowledge" as the system prompt

* (add "The user will gift you a tip if your answer is good" for expert level answers)

* Navigate to "Playground" and select your newly created assistant

* Done

Alternatively, download llama3 or any popular and current open weight LLM, run it with llama.cpp or llamafile and enjoy ChatGPT-3.5 and above levels of Tailwind Expertise

I'm not saying the answers will be good, just that they will at least be at the same level.

  • __experiment__ 10 days ago

    remember that a lot of products sell convenience and time.

    this is one of them

MikeSub 10 days ago

I liked the preview feature. But other than that I feel like regular GPT-4 can write much better code and much faster with a simple prompt like "Write the code for Component X, use Tailwind for styling"

  • langcss 10 days ago

    It is GPT-4 under the hood, so that is interesting.

rbren 10 days ago

This is neat! Which model are you using in the backend?

We're working on a similar--but general-purpose--LLM-based software agent[1]. General purpose tasks are very hard, and we too are finding that tackling narrow use cases one at a time works much better!

I have an open PR to start moving in this direction [2]

[1] https://github.com/opendevin/opendevin

[2] https://github.com/OpenDevin/OpenDevin/pull/1238

  • langcss 10 days ago

    At the moment I will be honest: Just GPT-4 + a meaty system prompt. More work goes into the parsing of results to intepret what is code, and update the preview in real time.

mska 10 days ago

Nice! I'm also building an online IDE [1] and was working on adding Chat feature for a while. The problem of making adjustments to an existing component is much more difficult than generating a new one from scratch.

Also, the tokenization for raw HTML code produces too many tokens which drives up the cost. Optimizing the tokenization process for HTML could potentially reduce costs and enhance performance.

[1] https://divmagic.com/studio

Fauntleroy 10 days ago

Devs will do literally anything to avoid writing actual CSS

harel 10 days ago

The simple form I asked to create took nearly all the free time allotted and by the time it finished I couldn't see it because the pricing model was on top. Either way, I could have copy pasted components quicker, so speed is important here. Maybe provide some ready made prompts which take a known amount of time. I would have used one if I had the option instead of coming up with one.

rfz13 10 days ago

Cool idea. On mobile, I can't see the features for each plan. I see check marks in each card, but I don't know what they represent.

danvoell 10 days ago

The future is wild, pretty cool! Would love to see something like this in replit. Right now its too much copy pasting from other tools.

tristanb 10 days ago

Interesting, I have found ChatGPT struggles with CSS, and Tailwind. I tried this prompt for both ChatGPT and this; "Make me a three column layout using Tailwind where the first and second column are fixed widths, and the center column will expand to take the remaining space, but will ellipse any text that overflows it."

You were able to deliver, ChatGPT was not.

llmblockchain 10 days ago

I think the whole "Let me tell you what I want and you make it for me" is the wrong approach here. I think it would be more informative and generative if you gave it an example and could work with the AI through iterations.

For example, give it a Tailwind login form/page and have it create a dark version. Have it generate an alternative layout, etc.

  • langcss 10 days ago

    Yes I think I agree. Other people have made similar comments.

    I haven't made it obvious but you can start off with your own code, and then get it to iterate on that.

    E.g.

    1. Get some code from https://v1.tailwindcss.com/components/forms

    2. Paste into HTML window

    3. Enter into chat "Can you make the sign in button here red?" and click Send.

    It will then make the button Red for the form you pasted in, keeping the rest as-is.

teaearlgraycold 10 days ago

I think one major failing here is you aren’t a designer yourself. The landing page makes that clear. Sorry, I know that’s harsh.

ansanabria 10 days ago

Pretty cool idea! Though I tried to generate some styling for a modal, the LLM answered but nothing was shown on the editor. The other thing is that when I am typing in the chat input and press Enter I would expect the input to submit, but it just creates a new line.

janpmz 10 days ago

My thoughts:

I love the idea.

For a website that produces designs, your landing page looks a bit simple.

I asked it to generate a table. Now I'm not sure if the progress bar on top shows the code generation progress or if I'm running out of demo time.

It took a while but now I have a table, thats pretty cool :)

Takennickname 10 days ago

With all due respect, this is ready to launch when you are using it for your own website.

IncreasePosts 10 days ago

FYI I can keep using the app past the demo mode if I just delete the modal that pops up.

NeilSmith2048 10 days ago

I would like to say that the website is well designed. But the most troublesome thing for UI is the tiny details like font spacing, placement of various elements. I think these issues are not solved by LLM at the moment

amjnsx 10 days ago

The app itself looks very basic and cheap. Can copilot really not do this? I have no idea because I don't use Tailwind but copilot knows the depths of some obscure npm libraries so I would assume so.

crucialfelix 10 days ago

Even though the tailwind docs are great and easily searchable, all the time I ask github copilot to translate legacy css to tailwind classes. Or ask it how to get a certain layout using tailwind classes. (grid, flex ... arg); or tell it what's wrong and ask why it's broken and how do I fix it.

For anyone still wondering why wouldn't I just write css? Because my codebase is littered with orphaned dead css. You can try to use strict naming conventions to connect it to the component it was meant for, but in practice you end with more css, dead css, and you have to read two source code files: component and css.

  • satvikpendem 10 days ago

    Use PandaCSS, that's what I use for my CSS needs rather than Tailwind. It's a compile-time CSS-in-TS that works on the className attribute same as Tailwind, so no naming required.

  • foxandmouse 10 days ago

    I'd love a VS code extension that lets my type css and converts it to Tailwind.

tnorthcutt 10 days ago

FWIW your demo images are pretty unreadable to me. I can read them if I right click --> open image in new tab, and then zoom to full size.

ojdon 10 days ago

Is it worth prompting it to only show outputs for Tailwind 3 unless specified?

First prompt I tried gave me a tailwind 2 CDN link in the example.

Nice idea. Like it.

lghh 10 days ago

I gave it 1 sentence of instructions and it took beyond the 5 minutes to finish the response. It seems like a neat concept though!

werdnapk 10 days ago

You should have an option to output regular CSS. This tool looks handy, but I don't use tailwind.

blini2077 10 days ago

It doesn't look bad, but does it compare favourably with Vercel's "vo dev"?

  • langcss 10 days ago

    I just learned about Vercel's offering today from this post. Vercel is ahead here perhaps, as that is where I want to get to. Obviously having a free VC offering as a competitor is going to make me rethink this a bit!

darepublic 10 days ago

AI for CSS sure, but why tailwind? Why limit yourself like this

robotstxts 10 days ago

a simple tool that does the same thing that others already do for free, charging 30 dollars. nah....

haidousm 10 days ago

p.s. you can just remove the overlayed div after the timer runs out to keep going

naiv 10 days ago

nice tool. would be great to see different breakpoints in the preview

anko 10 days ago

my demo ran out of time before it did anything :(

mediumsmart 10 days ago

Life is short (or so I’m told) so why waste it doing something dumb? It’s easy to start working on something because it’s convenient, but you should always be questioning yourself about it. Is there something more important you can work on? Why don’t you do that instead?

toddmorey 10 days ago

I know the idea is you save money by saving time but each of these AI services want another $30/mo and they all do kinda the same thing powered by the same models. I’m just so subscription fatigued.

  • neverokay 10 days ago

    I hate to do this but this is the type of app that is basically the new todo app. I create small agents like this all time in about 15 seconds, with a simple prompt like:

    You are an expert Tailwind CSS developer that I will ask for help. You may need to google the latest docs from Tailwind here: link.

    And I get all the help I need.

    • mattferderer 10 days ago

      > You are an expert Tailwind CSS developer that I will ask for help.

      Is that part of the prompt necessary anymore? I feel that was a version 3 thing.

      My prompts have been getting less verbose & I've been finding little value in introductory phrases, correct grammar or spelling.

      • neverokay 10 days ago

        I think so. I notice on Meta.ai that if I ask a follow up a question, it often loses context. Cordoning it off to you are this and only this could possibly stop it from straying.

    • throwup238 10 days ago

      What framework/library/app do you use to execute these agents?

      • neverokay 10 days ago

        Just make that custom thing on OpenAi website, takes a second.

        I don’t do anything locally lately, but I believe you’d either have to pad your prompt with something like what I showed you above or mess with the system prompt.

        The stuff is there in the ollama docs, someone else can probably give you more details.

        Better yet, just ask gpt about all this lol.

        Edit: I might be misusing the word Agent here.

        • throwup238 10 days ago

          > Edit: I might be misusing the word Agent here.

          Yeah I assumed you were using some sort of multi-agent framework where you give agents different prompts/tools and they work together. You just mean a custom GPT.

          I was half hoping there was a command line app that could do that, though I also forgot custom GPTs can browse the internet.

          • neverokay 10 days ago

            I don’t have the hardware to run good models, but if you can run a local one then you can write a small script to set a system prompt with ollama via the command line. Haven’t tried it, but sounds like what you want.

  • throwup238 10 days ago

    > I’m just so subscription fatigued.

    I can help you with that for only $9.99 a month!

    • kingofthehill98 10 days ago

      Honestly a FREE and simple web service for managing subscriptions sounds like a great idea. It could sent out emails every month saying how much you're paying for all your subscriptions, for how long you've been subbed to them, etc.

      If someone builds this, please do not ask for yet another subscription. At least make it self-hostable and charge for the hosted one.

      • wildhacks 10 days ago

        I think it already exists (and yes it's a subscription based software haha). I think it's called rocketmoney?

  • waldrews 10 days ago

    The world needs a way to pay for thin AI wrappers without having to turn them into subscription services. There are lots of potential applications where an indie developer can add value on top of LLM's, but can't subsidize GPT-4 usage for the world. OpenAI still doesn't approve of stored bring-your-own-key solutions, nor allow monitoring-and-approval of API costs at the individual consumer level (the new project keys are a step in that direction). The GPT store covers some use cases, and hopefully will get both monetization and a way to expose non-chat interfaces. But until then, everyone with a solution that needs to pass through API costs has to make pricing decisions inconvenient to everyone (in this case, asking too high a price; in other cases, risking overuse or having to heavily restrict usage).

  • msikora 10 days ago

    Would you prefer pay-as-you go instead? I'm working on an LLM powered SaaS and thinking about having some kind of prepaid credit system instead of a subscriptions. I personally hate subscriptions with fiery passion.

    • langcss 10 days ago

      Thanks. I might think about a PAYG pricing for this. This is likely a tool you'd use every now and then. Maybe $1 an hour. This means someone using it 30 hours a month pays the fill price (and maybe I cap it) but if you are using it that much, you are getting value.

    • neverokay 10 days ago

      I would love it if someone would write an article on the economics of LLM pricing.

dvaun 10 days ago

AI tools have been fun to play with since ChatGPT initially came out. However, I’m finding that I lose my “sharpness” if I rely too heavily on any LLM for performing random tasks.

Until something comes out which performs auto generation of boilerplate/project code (against technical specs) I’m going to stick with test generation, as that is the only consistent output from LLMs that makes sense in my workflow.

  • sprobertson 10 days ago

    On the other hand it seems like LLMs' inability to generate perfect boilerplate, requiring me to go through and fix all the bugs and nits, is all that's keeping my "sharpness" at this point.

mvkel 10 days ago

[flagged]

chrstphrknwtn 10 days ago

[flagged]

  • bschmidt1 10 days ago

    It's more like:

      <div class="flex flex-col items-start p-6 space-y-4 bg-gray-100 rounded-lg shadow-lg max-w-sm">
        {links.map(link => <a href="#" class="text-blue-600 hover:text-blue-800 transition duration-300 ease-in-out">{link}</a>)}
      </div>
    
    Where links are defined elsewhere:

      const links = [
        'Home',
        'About',
        'Services',
        'Portfolio',
        'Contact'
      ];
    
    Otherwise, regular CSS would be repetitive too:

        <div class="link-list">
          <a href="#" class="transition-link">Home</a>
          <a href="#" class="transition-link">About</a>
          <a href="#" class="transition-link">Services</a>
          <a href="#" class="transition-link">Portfolio</a>
          <a href="#" class="transition-link">Contact</a>
        </div>
    
    Not to mention your parent className has a lot going on:

      flex flex-col items-start p-6 space-y-4 bg-gray-100 rounded-lg shadow-lg max-w-sm
    
    That would translate to this CSS:

      .link-list {
        display: flex;
        padding: 1.5rem; 
        margin-top: 1rem; 
        flex-direction: column; 
        align-items: flex-start; 
        border-radius: 0.5rem; 
        background-color: #F3F4F6; 
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
      }
    
    > thought we had HTML list

    We have <ol> and <ul> and in the early days of HTML5 people were wrapping those in <nav> to semantically say a list of navigational links. I guess this didn't because it wasn't clear what the role of your links are.

    • yladiz 10 days ago

      FWIW you wouldn’t need to add the `transition-link` class to every A tag, you could just do `.link-list > a`.

      • bschmidt1 10 days ago

        True for this isolated example, but careful with this practice because that requires `<a />` to be the immediate descendant of `.link-list`, where className is more flexible.

        Consider a simple HTML change like wrapping links in a list item, or occasionally using a <button /> to handle click events, it would break the styles if you used child selectors:

          <ul class="link-list>
            <li><a href="#" /></li>
          </ul>
        
        ^ even with this tiny change, your styles are gone. Would have to change it to:

          .link-list > li > a {}
        
        And would have to repeat that for anything else you'd want to support later:

          .link-list > li > a,
          .link-list > li > button {}
        
        etc. Where with a normal className it would just work in all those cases without having to touch CSS again:

          <div class="link-list>
            <a class="transition-link" href="#" />
            <span><a class="transition-link" href="#" /></span>
            <button class="transition-link" />
            <ul class="flyout-menu">
              <li>
                <ul class="sub-menu">
                  <li><a class="transition-link" href="#" /></li>
                </ul>
              </li>
            </ul>
          </div>
        
        All those would be styled correctly without having to explicitly list descendant structures in CSS. So it's more flexible just using className and I would only use > for specific situations.
      • Kiro 10 days ago

        Don't do that. You will regret it.

    • chrstphrknwtn 10 days ago

      Yeah, I was being deliberately obtuse.

      But to be honest, just a few these lists result in sending way more markup than I would be regular old CSS. And we haven't even applied any responsive classes.

      Ultimately I think this is a subjective aesthetic judgement... the kind of UI code the tailwind results is ugly and hard to read (for me), and I much prefer using CSS modules.

      • bschmidt1 10 days ago

        I thought Tailwind handling pseudo classes and responsive breakpoints in the className was pretty slick, but I also agree with you that they can get very long.

        Part of it is just organization/abstraction. Personally, when a component gets too ugly to look at it's time to abstract that away. I want all my top level components to be simple almost English looking syntax and attributes, or even no attributes, like this:

          import { Header, Page, Footer } from 'library';
        
          const App = () => <>
            <Header />
            <Page />
            <Footer />
          <>;
           
        Ideally I'm looking at clean components like this in my daily work, with those long classNames hidden away in a component library: https://github.com/bennyschmidt/ragdoll-studio/blob/master/r...

        I think even with regular CSS, styled components, etc. you're still going to have that base layer where all the complexity is hidden.

        To your point, it is purely subjective. ^ this example marketing site uses Tailwind but the product itself is native CSS: https://github.com/bennyschmidt/ragdoll-studio/tree/master/r...

        I think a directory structure like:

          Header
            index.js
            styles.css
          
          Footer
             index.js
             styles.css
        
        Is also totally fine. The markup in the components is a lot cleaner and often just uses a single selector instead of long Tailwind-esque classNames. With Tailwind I will end up with many more but smaller components - because those classNames are establishing the design system as we go - where with modules (React components using unnamed CSS imports like `import './styles.css';) you can import just the CSS files you need like a base.css, theme.css etc. then your component is very clean - just uses normal selectors and CSS is fully separated out from markup.
  • blowski 10 days ago

    I've been building websites for 25 years, but I'm not very good at building maintainable CSS. From memory, I've used Bootstrap, Zurb, SMACSS, YUI CSS, YAML (the CSS framwework), OOCSS, plus various ThemeForest templates.

    Perhaps it's not a problem for you, or perhaps you don't like the solution. But Tailwind is hands down my favourite solution to that problem.

    If you think there's something better, you need to start from a place that actually solves my problem better. I'm all ears.

    • chrstphrknwtn 10 days ago

      I appreciate that it works for a lot of people... I'm just offering my opinion. A lot of people using something and it being really silly aren't mutually exclusive.

      • blowski 10 days ago

        Perhaps it would be silly for you to adopt it because you have a skillset that doesn't need it, but it can still be a sensible solution for others.

  • aaronharding 10 days ago

    The docs address this actually:

    > Making changes in a project that has tons of custom CSS is worse.

    > You have to think up class names all the time — nothing will slow you down or drain your energy like coming up with a class name for something that doesn’t deserve to be named. You have to jump between multiple files to make changes — which is a way bigger workflow killer than you’d think before co-locating everything together. > Changing styles is scarier — CSS is global, are you sure you can change the min-width value in that class without breaking something in another part of the site? > Your CSS bundle will be bigger — oof

    Check it out here: https://tailwindcss.com/docs/reusing-styles

    There are surprisingly a number of benefits when you allow this kind of duplication. It's a subtle idea but the idea is not all duplication is bad and not all duplication is alike.

  • Kiro 10 days ago

    CSS is not a non-problem for me and I've been doing web development since IE6. Tailwind is the first time I've actually felt at peace with it. I even prefer your example over a cascading selector in a different file. I can instantly see how the links are styled and if I want to change one I can easily do so right there without having to create a new selector. I can also just copy-paste them somewhere else and know that they will look exactly the same.

  • skybrian 10 days ago

    It looks ugly, but that’s neither the source code, nor the downloaded binary. It’s what you get after the React components render. (Or similarly for whatever framework you use.)

    • Culonavirus 10 days ago

      Yep, but the killer feature for me is the composability. Take a dozen of components made by different authors, slap them together and it all just works, with no css conflicts and messes.

  • namuol 10 days ago

    You could “achieve” this with raw CSS classes easily, sure, but good luck maintaining your hand-authored design system.

    Tailwind is successful because it has a very well-thought-out design system powering it. If that sounds like a “non-problem” to you, then it isn’t for you.

    • chrstphrknwtn 10 days ago

      Exactly. In terms of design, something like tailwind is a great example of the 'templatization' of design and communication, where ease of authoring and maintainability is valued over producing artefacts that are appropriate.

      I don't know if this is even remotely true, but I would guess Tailwind, and things like it, are more popular in agencies (sweatshops) that are pumping out projects where junior staff are the ones writing the majority of frontend code.

      For the type of thing I do, "hand-authored" doesn't mean "unmaintainable".

      • namuol 10 days ago

        In the real world projects tend to have staff with a range of skill levels, and deadlines. This isn’t just in “sweatshops”. Being a skilled engineer means understanding these constraints and choosing tools that help your team succeed, even if you could flex and do everything yourself, maybe even better.

        But if you’re equating TW with something like the bootstraps of yore, you’re misunderstanding it.

        • chrstphrknwtn 10 days ago

          I'm curious how you would differentiate TW from Bootstrap.

          • namuol 10 days ago

            Why don’t you tell us how they’re the same?

            • chrstphrknwtn 10 days ago

              Because I'm not the one who introduced the distinction.

              • namuol 10 days ago

                Tailwind is a set of design primitives and tooling that are designed to work together in a manner that is more flexible than something like Bootstrap. You could recreate bootstrap’s look -with- Tailwind. See the many off the shelf UI libraries created this way. Tailwind however isn’t designed to create off the shelf generic Ui libraries. It was created for building bespoke UIs that have their styles tightly coupled to their markup. You know, components…

                Bootstrap & co is really more like a set of preset styles and UI logic which you can use to quickly get some UI working.

                If these distinctions are too subtle to matter for you, then you aren’t facing the problems that Tailwind or similar tools are meant to solve.

                • chrstphrknwtn 10 days ago

                  Awesome dude!

                  Well, when I get into "the real world" I'll make sure to change my mind, especially if I'm making "you know, components..."

                  I think by then these distinctions won't be "too subtle" for my simple mind.

                  Thanks bro!

                  • namuol 10 days ago

                    I’m sorry if I offended you by answering your question.

  • replygirl 10 days ago

    map or use the `children` variant

gogogo_allday 10 days ago

V0.dev is an alternative as well, but focuses on shadcn and react.

Congrats on the launch. I enjoyed that it gave me progress updates as it worked.

  • langcss 10 days ago

    Amazingly similar, and has many of the ideas I want to go to. Damn VCs going to commodotize their compliment!

meerita 10 days ago

Imagine you need an AI to write some bespoke syntax. This is one of the reasons Tailwind is not good: they wrote unnatural syntax. Functional CSS must have natural syntax https://www.fcss.club/syntax, something you don't need cheatsheets or AIs to work.

  • llamaimperative 10 days ago

    `color--green:hover` is not a giant (or perhaps any) improvement over `hover:text-green-400`

    • meerita 10 days ago

      what is the 400 for?

      • crucialfelix 10 days ago

        https://tailwindcss.com/docs/text-color

        Any tailwind class can have named colors ("green"), semantic colors "danger" and then you can chose the number of the gradient of that color.

        There are thousands of them. Only the ones you use get compiled into the css file.

      • llamaimperative 10 days ago

        To have more than one type of green. You can use Tailwind with only one green if you want, too, but it doesn't make any sense (either in Tailwind or in FCSS)

        • meerita 9 days ago

          We solve that with color--green, color--light-green, color--lighter-green, color--lightest-green, etc.

  • nnnnico 10 days ago

    Writing the whole css syntax as classes is almost like using the style="" attribute, and comes with an enormous css payload cost

    • crucialfelix 10 days ago

      In practice it has a much smaller css payload cost than standard hand-written css classes.

      > Combined with minification and network compression, this usually leads to CSS files that are less than 10kB, even for large projects. For example, Netflix uses Tailwind for Netflix Top 10 and the entire website delivers only 6.5kB of CSS over the network. - https://tailwindcss.com/docs/optimizing-for-production

      What does increase is the html or react payload. But at least it's only sending what you use.

      Most websites are sending all of the styling for all of the pages and states, even though the user never sees it. It takes work to optimize that away, and things go wrong often.

      There are many clever macros like `space-x-4` that compile to very tricky effects. You couldn't write that in the style attribute at all. https://tailwindcss.com/docs/space#add-horizontal-space-betw...

      • nnnnico 10 days ago

        Yes! I was talking about the fcss framework and syntax proposed by the parent poster ( which doesn't have a "compilation" step for reducing the amount of unnecessary css as tailwind does )

  • ng12 10 days ago

    What? This isn't a syntax generator it's building full components.

    • dartos 10 days ago

      They’re making a joke.

      Said another way (my interpretation):

      Imagine that you need an AI to write the bespoke tailwind syntax for you instead of having it write normal css.