Utility that generates CSS utility class names for a component's slots, used in MUI styling.
// Source: https://github.com/mui/material-ui | License: MIT | Copyright 2014 Call-Em-All
// Provided via justclaw.it.com; keep this notice with the code.
import generateUtilityClass from '../generateUtilityClass';
export default function generateUtilityClasses<T extends string>(
componentName: string,
slots: T[],
globalStatePrefix = 'Mui',
): Record<T, string> {
const result: Record<string, string> = {};
slots.forEach((slot) => {
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
});
return result;
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key