worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
60
node_modules/@mui/material/esm/styles/createGetSelector.js
generated
vendored
Normal file
60
node_modules/@mui/material/esm/styles/createGetSelector.js
generated
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import excludeVariablesFromRoot from "./excludeVariablesFromRoot.js";
|
||||
export default theme => (colorScheme, css) => {
|
||||
const root = theme.rootSelector || ':root';
|
||||
const selector = theme.colorSchemeSelector;
|
||||
let rule = selector;
|
||||
if (selector === 'class') {
|
||||
rule = '.%s';
|
||||
}
|
||||
if (selector === 'data') {
|
||||
rule = '[data-%s]';
|
||||
}
|
||||
if (selector?.startsWith('data-') && !selector.includes('%s')) {
|
||||
// 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
|
||||
rule = `[${selector}="%s"]`;
|
||||
}
|
||||
if (theme.defaultColorScheme === colorScheme) {
|
||||
if (colorScheme === 'dark') {
|
||||
const excludedVariables = {};
|
||||
excludeVariablesFromRoot(theme.cssVarPrefix).forEach(cssVar => {
|
||||
excludedVariables[cssVar] = css[cssVar];
|
||||
delete css[cssVar];
|
||||
});
|
||||
if (rule === 'media') {
|
||||
return {
|
||||
[root]: css,
|
||||
[`@media (prefers-color-scheme: dark)`]: {
|
||||
[root]: excludedVariables
|
||||
}
|
||||
};
|
||||
}
|
||||
if (rule) {
|
||||
return {
|
||||
[rule.replace('%s', colorScheme)]: excludedVariables,
|
||||
[`${root}, ${rule.replace('%s', colorScheme)}`]: css
|
||||
};
|
||||
}
|
||||
return {
|
||||
[root]: {
|
||||
...css,
|
||||
...excludedVariables
|
||||
}
|
||||
};
|
||||
}
|
||||
if (rule && rule !== 'media') {
|
||||
return `${root}, ${rule.replace('%s', String(colorScheme))}`;
|
||||
}
|
||||
} else if (colorScheme) {
|
||||
if (rule === 'media') {
|
||||
return {
|
||||
[`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
|
||||
[root]: css
|
||||
}
|
||||
};
|
||||
}
|
||||
if (rule) {
|
||||
return rule.replace('%s', String(colorScheme));
|
||||
}
|
||||
}
|
||||
return root;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue