mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-21 10:37:51 +02:00
fix(css-cascade-layers): fix windows css cascade layers bug (#11241)
This commit is contained in:
parent
ef23f546fd
commit
d3ab0e63a0
2 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "3.8.0",
|
"@docusaurus/core": "3.8.0",
|
||||||
"@docusaurus/types": "3.8.0",
|
"@docusaurus/types": "3.8.0",
|
||||||
|
"@docusaurus/utils": "3.8.0",
|
||||||
"@docusaurus/utils-validation": "3.8.0",
|
"@docusaurus/utils-validation": "3.8.0",
|
||||||
"tslib": "^2.6.0"
|
"tslib": "^2.6.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
import {Joi} from '@docusaurus/utils-validation';
|
import {Joi} from '@docusaurus/utils-validation';
|
||||||
|
import {posixPath} from '@docusaurus/utils';
|
||||||
import {isValidLayerName} from './layers';
|
import {isValidLayerName} from './layers';
|
||||||
import type {OptionValidationContext} from '@docusaurus/types';
|
import type {OptionValidationContext} from '@docusaurus/types';
|
||||||
|
|
||||||
|
@ -20,7 +21,10 @@ export type Options = {
|
||||||
// Not ideal to compute layers using "filePath.includes()"
|
// Not ideal to compute layers using "filePath.includes()"
|
||||||
// But this is mostly temporary until we add first-class layers everywhere
|
// But this is mostly temporary until we add first-class layers everywhere
|
||||||
function layerFor(...params: string[]) {
|
function layerFor(...params: string[]) {
|
||||||
return (filePath: string) => params.some((p) => filePath.includes(p));
|
return (filePath: string) => {
|
||||||
|
const posixFilePath = posixPath(filePath);
|
||||||
|
return params.some((p) => posixFilePath.includes(p));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object order matters, it defines the layer order
|
// Object order matters, it defines the layer order
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue