Plumeria logo/ ✾ Plumeria
API reference

ServerCSS

Headless component

A headless component for facilitating server-side js for Next.js only.

It is safe to know

It will be null in non-development environments and will not be included in production environments.

layout.tsx
import { ServerCSS } from '@plumeria/next';
 
export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <head>
        <ServerCSS />
      </head>
      <body>
        <main>{children}</main>
      </body>
    </html>
  );
}

Turbopack

To use it with "next dev --turbopack", you need to adapt it to the CJS environment.

const { ServerCSS } = require('@plumeria/next');

To import it, use CJS require.

const { css } = require('@plumeria/core');

On this page

;