Skip to Content
Nextra 4.0 is released. Read more

Custom CSS Support

Nextra is 100% compatible with the built-in CSS support of Next.js , including .css, .module.css, and Sass (.scss, .sass, .module.scss, .module.sass) files.

For example, consider the following stylesheet named styles.css:

styles.css
body {
  font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica',
    'Arial', sans-serif;
  padding: 20px 20px 60px;
  max-width: 680px;
  margin: 0 auto;
}

Import your CSS files in root layout:

app/layout.jsx
import '../path/to/your/styles.css'
 
export default async function RootLayout({ children }) {
  // ...
}

To learn more about CSS support in Next.js, check out the Next.js documentation .

Last updated on