Coder Social home page Coder Social logo

Comments (6)

leo-cheron avatar leo-cheron commented on September 21, 2024 1

@leo-cheron Tailwindcss by default generates 1 CSS file, as mentioned by @nhducit!

I guess I'll have to combine it with modules to manually split some heavy chunks.

from next.js.

nhducit avatar nhducit commented on September 21, 2024

This is how Tailwind works. You will get the same result with SolidStart, Svelte Kit, or Nuxt.

Next.js cannot do anything here.

from next.js.

jantimon avatar jantimon commented on September 21, 2024

For MS Teams Microsoft used auto generated atomic styles (so basically similar to tailwind but auto generated) from their code resulting in a 1 MB .css file:

mui/material-ui#38137 (comment)

Why it matters? In a large application, you must preload CSS for the entire app. You can't load something later without incurring a performance hit.

300102904-dabac08c-c035-4192-b81a-8de7561c25ed

from next.js.

samcx avatar samcx commented on September 21, 2024

@leo-cheron Tailwindcss by default generates 1 CSS file, as mentioned by @nhducit!

from next.js.

oliviertassinari avatar oliviertassinari commented on September 21, 2024

I would be very interested in a benchmark on the cost of not having code spitting for Tailwind CSS. There seems to be a cost:

If you extract everything into literally a single CSS file for your whole site you might get away with just putting a <link> reactwg/react-18#106 and call it a day. That might not be such a bad idea for many small sites that use atomic CSS or reusable rules like tailwind. Those tend to plateau in their size growth.

However, even in those systems you eventually tend to grow out of them and loading all CSS up front becomes a bad idea. In those cases you want to inject CSS files based on if they're used by the components you're rendering on the server.

SCR-20240310-ucqw

from next.js.

github-actions avatar github-actions commented on September 21, 2024

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

from next.js.

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.