diff --git a/lib/cli/cli.js b/lib/cli/cli.js index 6e8c13e6f..2b9afdd1d 100644 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -1783,6 +1783,12 @@ export async function parseCommandLine() { 'Configure the thresholds for red/yellow/green for the summary boxes.', group: 'HTML' }) + .option('html.darkMode', { + alias: ['darkMode'], + describe: 'View test results with a dark theme.', + default: false, + type: 'boolean' + }) .option('summary', { describe: 'Show brief text summary to stdout', default: false, @@ -2013,12 +2019,6 @@ export async function parseCommandLine() { describe: 'Open your test result in your default browser (Mac OS or Linux with xdg-open).' }) - .option('darkMode', { - alias: ['d'], - describe: 'View test results with a dark theme.', - default: false, - type: 'boolean' - }) .option('slug', { describe: 'Give your test a slug. The slug is used when you send the metrics to your data storage to identify the test and the folder of the tests. The max length of the slug is 200 characters and it can only contain a-z A-Z 0-9 and -_ characters.' diff --git a/lib/plugins/html/templates/layout.pug b/lib/plugins/html/templates/layout.pug index 04bccdd77..5c45cb263 100644 --- a/lib/plugins/html/templates/layout.pug +++ b/lib/plugins/html/templates/layout.pug @@ -6,7 +6,7 @@ html(lang='en') title= pageTitle meta(name='description', content=pageDescription) meta(name='robots', content='noindex') - if options.darkMode + if options.html.darkMode link(rel='stylesheet', href=assetsPath + 'css/index-dark.min.css') else link(rel='stylesheet', href=assetsPath + 'css/index-light.min.css')