Skip to content

Commit

Permalink
[Typography] Add color=textPrimary option
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jul 28, 2018
1 parent ee9bc65 commit f93ef19
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/material-ui/src/Typography/Typography.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Style, TextStyle } from '../styles/createTypography';
export interface TypographyProps
extends StandardProps<React.HTMLAttributes<HTMLElement>, TypographyClassKey> {
align?: PropTypes.Alignment;
color?: PropTypes.Color | 'textSecondary' | 'error';
color?: PropTypes.Color | 'textPrimary' | 'textSecondary' | 'error';
component?: React.ReactType<TypographyProps>;
gutterBottom?: boolean;
headlineMapping?: { [type in TextStyle]: string };
Expand Down
16 changes: 14 additions & 2 deletions packages/material-ui/src/Typography/Typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export const styles = theme => ({
colorSecondary: {
color: theme.palette.secondary.main,
},
/* Styles applied to the root element if `color="textPrimary"`. */
colorTextPrimary: {
color: theme.palette.text.primary,
},
/* Styles applied to the root element if `color="textSecondary"`. */
colorTextSecondary: {
color: theme.palette.text.secondary,
Expand All @@ -89,8 +93,8 @@ function Typography(props) {
align,
classes,
className: classNameProp,
component: componentProp,
color,
component: componentProp,
gutterBottom,
headlineMapping,
noWrap,
Expand Down Expand Up @@ -138,7 +142,15 @@ Typography.propTypes = {
/**
* The color of the component. It supports those theme colors that make sense for this component.
*/
color: PropTypes.oneOf(['inherit', 'primary', 'textSecondary', 'secondary', 'error', 'default']),
color: PropTypes.oneOf([
'default',
'error',
'inherit',
'primary',
'secondary',
'textPrimary',
'textSecondary',
]),
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
Expand Down

0 comments on commit f93ef19

Please sign in to comment.