Default: nextjs.liyaodong.com
Dark: darknextjs.liyaodong.com
Refer to pages/index.tsx
#getThemeFromHostName function
function getThemeFromHostName(context) {
let theme = 'default';
// only run on client side
if (!process.browser) {
return theme;
}
// can be an api call as well
if (/dark/i.test(window.location.hostname)) {
theme = 'dark';
}
if (/red/i.test(window.location.hostname)) {
theme = { '@primary-color': '#ff0000' };
}
return theme;
}