Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styles API #3

Open
3 of 10 tasks
kLabz opened this issue Oct 2, 2019 · 2 comments
Open
3 of 10 tasks

Styles API #3

kLabz opened this issue Oct 2, 2019 · 2 comments

Comments

@kLabz
Copy link
Owner

kLabz commented Oct 2, 2019

From https://github.com/mui-org/material-ui/blob/master/packages/material-ui-styles/src/index.d.ts

  • export { default as createGenerateClassName } from './createGenerateClassName';
  • export { default as createStyles } from './createStyles';
  • export { default as getThemeProps } from './getThemeProps';
  • export { default as jssPreset } from './jssPreset';
  • export { default as makeStyles } from './makeStyles';
  • export { default as mergeClasses } from './mergeClasses';
  • export { default as ServerStyleSheets } from './ServerStyleSheets';
  • export { default as styled } from './styled';
  • export { default as StylesProvider } from './StylesProvider';
  • export { default as ThemeProvider } from './ThemeProvider';
@kLabz
Copy link
Owner Author

kLabz commented Dec 1, 2019

Will need proper jss externs
See https://github.com/cssinjs/jss/blob/master/packages/jss/src/index.d.ts for types

@kLabz
Copy link
Owner Author

kLabz commented Jul 10, 2020

  • Need to expose fade, etc. from '@material-ui/core/styles' too

Edit:

From @material-ui/core/styles/colorManipulator.d.ts, actually:

export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla';
export interface ColorObject {
  type: ColorFormat;
  values: [number, number, number] | [number, number, number, number];
}

export function hexToRgb(hex: string): string;
export function rgbToHex(color: string): string;
export function hslToRgb(color: string): string;
export function decomposeColor(color: string): ColorObject;
export function recomposeColor(color: ColorObject): string;
export function getContrastRatio(foreground: string, background: string): number;
export function getLuminance(color: string): number;
export function emphasize(color: string, coefficient?: number): string;
export function fade(color: string, value: number): string;
export function darken(color: string, coefficient?: number): string;
export function lighten(color: string, coefficient?: number): string;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant