diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 5bc7dc94..5a3bd8d7 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -1,8 +1,8 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const lightCodeTheme = require('./src/themes/prismLight'); +const darkCodeTheme = require('./src/themes/prismDark'); const GITHUB_URL = 'https://github.com/go-task/task'; const TWITTER_URL = 'https://twitter.com/taskfiledev'; diff --git a/docs/src/themes/prismDark.js b/docs/src/themes/prismDark.js new file mode 100644 index 00000000..84af2732 --- /dev/null +++ b/docs/src/themes/prismDark.js @@ -0,0 +1,79 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const darkTheme = require('prism-react-renderer/themes/vsDark/index.cjs.js'); + +module.exports = { + plain: { + color: '#D4D4D4', + backgroundColor: '#212121' + }, + styles: [ + ...darkTheme.styles, + { + types: ['title'], + style: { + color: '#569CD6', + fontWeight: 'bold' + } + }, + { + types: ['property', 'parameter'], + style: { + color: '#9CDCFE' + } + }, + { + types: ['script'], + style: { + color: '#D4D4D4' + } + }, + { + types: ['boolean', 'arrow', 'atrule', 'tag'], + style: { + color: '#569CD6' + } + }, + { + types: ['number', 'color', 'unit'], + style: { + color: '#B5CEA8' + } + }, + { + types: ['font-matter'], + style: { + color: '#CE9178' + } + }, + { + types: ['keyword', 'rule'], + style: { + color: '#C586C0' + } + }, + { + types: ['regex'], + style: { + color: '#D16969' + } + }, + { + types: ['maybe-class-name'], + style: { + color: '#4EC9B0' + } + }, + { + types: ['constant'], + style: { + color: '#4FC1FF' + } + } + ] +}; diff --git a/docs/src/themes/prismLight.js b/docs/src/themes/prismLight.js new file mode 100644 index 00000000..062055d8 --- /dev/null +++ b/docs/src/themes/prismLight.js @@ -0,0 +1,100 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const lightTheme = require('prism-react-renderer/themes/github/index.cjs.js'); + +module.exports = { + ...lightTheme, + styles: [ + ...lightTheme.styles, + { + types: ['title'], + style: { + color: '#0550AE', + fontWeight: 'bold' + } + }, + { + types: ['parameter'], + style: { + color: '#953800' + } + }, + { + types: ['boolean', 'rule', 'color', 'number', 'constant', 'property'], + style: { + color: '#005CC5' + } + }, + { + types: ['atrule', 'tag'], + style: { + color: '#22863A' + } + }, + { + types: ['script'], + style: { + color: '#24292E' + } + }, + { + types: ['operator', 'unit', 'rule'], + style: { + color: '#D73A49' + } + }, + { + types: ['font-matter', 'string', 'attr-value'], + style: { + color: '#C6105F' + } + }, + { + types: ['class-name'], + style: { + color: '#116329' + } + }, + { + types: ['attr-name'], + style: { + color: '#0550AE' + } + }, + { + types: ['keyword'], + style: { + color: '#CF222E' + } + }, + { + types: ['function'], + style: { + color: '#8250DF' + } + }, + { + types: ['selector'], + style: { + color: '#6F42C1' + } + }, + { + types: ['variable'], + style: { + color: '#E36209' + } + }, + { + types: ['comment'], + style: { + color: '#6B6B6B' + } + } + ] +};