Skip to content

Commit

Permalink
[utils] Add typings for @mui-material/styles/cssUtils (#29621)
Browse files Browse the repository at this point in the history
  • Loading branch information
Semigradsky authored Dec 2, 2021
1 parent 122252e commit 8e5a7a9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/mui-material/src/styles/cssUtils.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { CSSProperties } from './createTypography';

export function isUnitless(value: string): boolean;

export function getUnit(input: string): string;

export function toUnitless(value: string): number;

export function convertLength(baseFontSize: string): (length: string, toUnit: string) => string;

export interface AlignPropertyParams {
size: number;
grid: number;
}
export function alignProperty(params: AlignPropertyParams): number;

export interface FontGridParams {
lineHeight: number;
pixels: number;
htmlFontSize: number;
}
export function fontGrid(params: FontGridParams): number;

export interface ResponsivePropertyParams {
cssProperty: string;
min: number;
max: number;
unit?: string;
breakpoints?: number[];
transform?: (value: number) => number;
}
export function responsiveProperty(params: ResponsivePropertyParams): CSSProperties;
1 change: 1 addition & 0 deletions packages/mui-material/src/styles/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export { ComponentsProps, ComponentsPropsList } from './props';
export { ComponentsVariants } from './variants';
export { ComponentsOverrides, ComponentNameToClassKey } from './overrides';
export { Components } from './components';
export { getUnit as unstable_getUnit, toUnitless as unstable_toUnitless } from './cssUtils';

export type ClassNameMap<ClassKey extends string = string> = Record<ClassKey, string>;

Expand Down

0 comments on commit 8e5a7a9

Please sign in to comment.