worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
28
node_modules/@mui/system/cssVars/createGetCssVar.js
generated
vendored
Normal file
28
node_modules/@mui/system/cssVars/createGetCssVar.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createGetCssVar;
|
||||
/**
|
||||
* The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
|
||||
* and they does not need to remember the prefix (defined once).
|
||||
*/
|
||||
function createGetCssVar(prefix = '') {
|
||||
function appendVar(...vars) {
|
||||
if (!vars.length) {
|
||||
return '';
|
||||
}
|
||||
const value = vars[0];
|
||||
if (typeof value === 'string' && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)) {
|
||||
return `, var(--${prefix ? `${prefix}-` : ''}${value}${appendVar(...vars.slice(1))})`;
|
||||
}
|
||||
return `, ${value}`;
|
||||
}
|
||||
|
||||
// AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
|
||||
const getCssVar = (field, ...fallbacks) => {
|
||||
return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...fallbacks)})`;
|
||||
};
|
||||
return getCssVar;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue