# Critical CSS extraction
Since Linaria extracts the CSS statically at build time, you don't need to setup a server rendering. Usually, critical CSS extraction will be automatic if you are code splitting your code and using something like [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) for webpack to generate your CSS files.
If you're not code splitting, or the initial CSS chunk is not representative of initially rendered content, you might want to extract critical CSS using the `collect` helper we provide to ship the minimal amount of CSS used in the page to the browser. To be able to use the `collect` helper, you need to provide the initial HTML, which usually means that you need to have SSR setup for your web app.
The `collect` method takes some HTML and CSS and gives you the critical CSS:
```js
import { collect } from '@linaria/server';
const { critical, other } = collect(html, css);
```
For example, in an express app with React, you could do something like the following:
```js
import fs from 'fs';
import express from 'express';
import crypto from 'crypto';
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import { collect } from '@linaria/server';
import App from './App';
const cache = {};
const css = fs.readFileSync('./dist/styles.css', 'utf8');
const app = express();
app.get('/', (req, res) => {
const html = ReactDOMServer.renderToString(