{"repo":"dlehmhus/next-with-linaria","free":true,"listed":false,"github":"https://github.com/dlehmhus/next-with-linaria","clone":"git clone https://github.com/dlehmhus/next-with-linaria.git","description":"Linaria loader for Next.js","language":"TypeScript","stars":140,"topics":["css","loader","nextjs","webpack","linaria","rspack","turbopack"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Next.js + Linaria What is this? This package provides seamless integration between Next.js and Linaria, a zero-runtime CSS-in-JS solution. It allows you to use Linaria's powerful styling capabilities directly in your Next.js applications, with full support for both the App Router and Pages Router. Try it Installation [!IMPORTANT] Next.js 16 requires next-with-linaria version 1.3.0 or higher. npm pnpm yarn Usage Webpack / Turbopack Rspack To use Rspack instead of Webpack, you can combine this package with next-rspack : Now you can use linaria in all the places where Next.js also allows you to use CSS Modules. That currently means in every file in the app directory and the pages directory. Performance Optimization The fastCheck option is enabled by default to improve build performance. This optimization skips the Linaria transform process for files that don't contain Linaria syntax, which can reduce build times for large projects. If you experience any issues with the optimization, you can disable it: Restrictions Global Styles If you want to use linaria for global styling, you need to place those styles into a file with the suffix .linaria.global.(js jsx ts tsx) : This convention is needed because the loader needs to know which files contain global styles and which don't. Limitations - In Webpack and Rspack you can not use linaria styles in server-only files or in server components that import server-only files due to the way HMR works in dev mode. In such a case you need to u","default_branch":null,"files":null,"tree":[],"storefront":"/r/dlehmhus","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dlehmhus/next-with-linaria/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}