Custom CSS

You can customize the look and feel of your Mosaic site by creating cusotm CSS files. Here is a step-by-step guide to help you create your own CSS theme.

Create a CSS folder

To get started, create a folder named "css" in the "src" folder of your Mosaic project.

src/
└── css/

Create your theme

Inside the "css" folder, create a folder named "global". This is where you will add your custom styles.

src/
└── css/
    ├── global/
    ├── index.css

Create an "index.css" file inside the "css" folder. This file will import your custom styles.

@import './global/';

Inside your global folder, create a separate CSS file for each part of your site that you want to customize. For instance, if you want to change the text styling, create a "text.css" file inside the "global" folder. Here is an example of how your "text.css" file could look like:

h1 {
  /* Set custom font size and weight */
  font-size: /* insert value */ ;
  font-weight: /* insert value */ ;
}

h2 {
  font-size: /* insert value */ ;
  font-weight: /* insert value */ ;
}

h3 {
  font-size: /* insert value */ ;
  font-weight: /* insert value */ ;
}

h4 {
  font-size: /* insert value */ ;
  font-weight: /* insert value */ ;
}

h5 {
  font-size: /* insert value */ ;
  font-weight: /* insert value */ ;
}

h6 {
  font-size: /* insert value */ ;
  font-weight: /* insert value */ ;
}

p {
  font-size: /* insert value */ ;
  line-height: /* insert value */ ;
}

You can add as many CSS files as you need, depending on how much you want to customize your site.

Create an "index.css" file inside the "global" folder. This file will import your custom styles, in this example we are importing our "text.css" file.

@import './text.css';

Your "css" folder should now look like this:

src/
└── css/
    ├── global/
    │   ├── text.css
    │   ├── index.css
    ├── index.css

Import your custom CSS into your site

To apply your custom styles to your Mosaic site, open your src/app/layout.tsx file and add the following line to the bottom of your imports:

import '../css/index.css';

Note: in the App Router, global CSS must be imported from the root layout (app/layout.tsx). Importing global CSS from a client component or any non-layout file is rejected by Next.js at build time.

Congratulations! You have successfully applied your custom CSS styles to your site. This example demonstrated how to create text styles, but you can use the same approach to customize other aspects of your site as well.

Mosaic BETA

Coming soon