mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 12:37:01 +02:00
feat(v2): allow to use array of files in customCss field (#3474)
* feat(v2): allow to use array of files in customCss field * customCss array: - fix bug (push instead of concat) - update docs - add theme config validation + tests Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
cc31567459
commit
ae2c063929
8 changed files with 53 additions and 7 deletions
|
@ -165,6 +165,10 @@ const FooterLinkItemSchema = Joi.object({
|
|||
// (users may need additional attributes like target, aria-role, data-customAttribute...)
|
||||
.unknown();
|
||||
|
||||
const CustomCssSchema = Joi.alternatives()
|
||||
.try(Joi.array().items(Joi.string().required()), Joi.string().required())
|
||||
.optional();
|
||||
|
||||
const ThemeConfigSchema = Joi.object({
|
||||
// TODO temporary (@alpha-58)
|
||||
disableDarkMode: Joi.any().forbidden(false).messages({
|
||||
|
@ -176,6 +180,7 @@ const ThemeConfigSchema = Joi.object({
|
|||
'any.unknown':
|
||||
'defaultDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.defaultMode = "dark"',
|
||||
}),
|
||||
customCss: CustomCssSchema,
|
||||
colorMode: ColorModeSchema,
|
||||
image: Joi.string(),
|
||||
metadatas: Joi.array()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue