-
Notifications
You must be signed in to change notification settings - Fork 1
Creating custom themes
Themes are written in SCSS. Currently there is no support for alternative CSS pre- or post-processers.
Adding custom themes is a four step process. There is also code below that can be used as a template for developing new themes.
- Create the
_settings.scss
file; - Add the core theme SCSS, as well as any fonts and images that the theme uses;
- Create an
index.js
with a list of the theme's assets; - Add your theme to the
themes
directory
A completed theme's structure will look something like this:
b-ber-theme-custom
├── _settings.scss
├── application.scss
├── fonts
│ └── my-font.otf
│ └── my-font.ttf
├── images
│ └── my-image.jpg
├── index.js
Note
All b-ber theme names must be prefixed with b-ber-theme
, i.e., b-ber-theme-custom
, b-ber-theme-example
.
List all the variables and mixins that you want to be made available to the end-user.
// _settings.scss
$black: #222;
$white: #fff;
Create an entry-point SCSS file for the styles. You can import
other files or libraries as you like and b-ber will include these during compilation.
// application.scss
@import 'settings';
body {
font-size: 1em;
}
index.js
must list all of the assets that your theme is using. The entry
property must be the path to application.scss
.
You can copy, paste, and modify the code below for your own index.js
file:
module.exports = {
name: 'b-ber-theme-custom', // Required, must be a unique name
entry: './application.scss', // A relative or absolute path to the main SCSS file
fonts: [ // An array of the fonts used in the theme or an empty array
'my-font.otf',
'my-font.ttf',
]
images: [ // An array of the images used in the theme or an empty array
'my-image.jpg'
],
}
Add the new theme to the b-ber project's themes
directory.
my-project
├── _project
├── themes
│ └── b-ber-theme-custom
│ ├── _settings.scss
│ ├── application.scss
│ ├── fonts
│ │ ├── my-font.otf
│ │ └── my-font.ttf
│ ├── images
│ │ └── my-image.jpg
│ └── index.js
...
- Adding metadata
- Creating content
- Generating new content
- Authoring and editing content
- Reading order (Table of Contents)
- Configuring the build
- Adding a cover image
- All directives
- Text
- Media
- Misc