mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 22:18:44 +02:00
fix(theme-classic): resolve customCss from site dir (#7363)
This commit is contained in:
parent
29b015de18
commit
c0bd145a29
2 changed files with 8 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import type {LoadContext, Plugin} from '@docusaurus/types';
|
||||
import type {ThemeConfig} from '@docusaurus/theme-common';
|
||||
import {getTranslationFiles, translateThemeConfig} from './translations';
|
||||
|
@ -142,11 +143,11 @@ export default function themeClassic(
|
|||
];
|
||||
|
||||
if (customCss) {
|
||||
if (Array.isArray(customCss)) {
|
||||
modules.push(...customCss);
|
||||
} else {
|
||||
modules.push(customCss);
|
||||
}
|
||||
modules.push(
|
||||
...(Array.isArray(customCss) ? customCss : [customCss]).map((p) =>
|
||||
path.resolve(context.siteDir, p),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return modules;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue