-
Notifications
You must be signed in to change notification settings - Fork 218
Customization
Ingo edited this page Sep 6, 2025
·
5 revisions
To modify a theme or create your own, follow the steps below. You'll need to have Node, and Grunt installed.
Note
Always modify the sass files not the compiled css file
In /wwwroot/lib/themes/ folder are the sources versions of all themes, which will be compiled to the /wwwroot/css/themes/folder.
- So modify the
/wwwroot/lib/themes/[theme]/bootstrap-forum.scssfor the website and the/wwwroot/lib/themes/[theme]/bootstrap-email.scssfor the email templates. - And build them with grunt...
> grunt css- and update the email templates (if necessary)
> grunt emailTemplatesCreate a new folder in the /wwwroot/lib/themes/ folder. for easier start just duplicate an existing theme. the folder needs the following files...
| File | Description |
|---|---|
| _variables.scss | variables for the site |
| _variables-email.scss | variables for the email templates |
| bootstrap_email.json | config file for email templates |
| bootstrap_email-digest.json | config file for email digest template |
| bootstrap_email.scss | main style file for the site |
| bootstrap-forum.scss | main style file for the email template |
- in the email template files (
bootstrap_email.jsonandbootstrap_email-digest.json) the theme name need to be updated for thesass_email_locationsetting
"sass_email_location": "../../YetAnotherForum.NET/wwwroot/lib/Themes/[theme]/"- the grunt tasks (in the
Gruntfile.js) needed to be updated in order to compile the new theme.
themes: {
files: {
...
"wwwroot/css/themes/[theme]/bootstrap-forum.min.css":
'wwwroot/lib/themes/[theme]/bootstrap-forum.scss'
}themes: {
files: {
...
"wwwroot/css/themes/[theme]/bootstrap-forum.min.css":
'wwwroot/css/themes/[theme]/bootstrap-forum.min.css'
}emailTemplates: {
command: [
'@echo off',
'cd ..\\Tools\\BootstrapEmail\\',
'echo Build [theme] theme email template',
'BootstrapEmail.Cli -f ../../YetAnotherForum.NET/wwwroot/Resources/EmailTemplate.html -d ../../YetAnotherForum.NET/wwwroot/css/themes/[theme]/EmailTemplate.html -c ../../YetAnotherForum.NET/wwwroot/lib/themes/[theme]/bootstrap_email.json',
....
'rmdir .sass-cache /s /q'
].join('&&')
},
emailDigestTemplates: {
command: [
'@echo off',
'cd ..\\Tools\\BootstrapEmail\\',
'echo Build [theme] theme digest email template',
'BootstrapEmail.Cli -f ../../YetAnotherForum.NET/wwwroot/Resources/DigestTopicTemplate.html -d ../../YetAnotherForum.NET/wwwroot/css/themes/[theme]/DigestTopicTemplate.html -c ../../YetAnotherForum.NET/wwwroot/lib/themes/[theme]/bootstrap_email-digest.json',
...
'rmdir .sass-cache /s /q'
].join('&&')
},YetAnotherForum.NET (YAF) the Open Source Discussion Forum for ASP.NET - https://YetAnotherForum.NET
Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved