Skip to content

Commit

Permalink
Merge pull request mui#1995 from KaeruCT/cardTextTextColor
Browse files Browse the repository at this point in the history
[Theme] Making card-text pull its text color from the theme
  • Loading branch information
oliviertassinari committed Oct 28, 2015
2 parents aa7e541 + 83c610f commit 9ccc4e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/card/card-text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CardText = React.createClass({
},

getInitialState() {
return {
return {
muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),
};
},
Expand All @@ -44,18 +44,13 @@ const CardText = React.createClass({
actAsExpander: React.PropTypes.bool,
},

getDefaultProps() {
return {
color: Styles.Colors.ck,
};
},

getStyles() {
const themeVariables = this.state.muiTheme.cardText;
return {
root: {
padding: 16,
fontSize: '14px',
color: this.props.color,
color: this.props.color ? this.props.color : themeVariables.textColor,
},
};
},
Expand Down
5 changes: 5 additions & 0 deletions src/styles/theme-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = {
minWidth: 88,
iconButtonSize: rawTheme.spacing.iconSize * 2,
},
cardText: {
textColor: rawTheme.palette.textColor,
},
checkbox: {
boxColor: rawTheme.palette.textColor,
checkedColor: rawTheme.palette.primary1Color,
Expand Down Expand Up @@ -180,6 +183,8 @@ module.exports = {
},
tabs: {
backgroundColor: rawTheme.palette.primary1Color,
textColor: ColorManipulator.fade(rawTheme.palette.alternateTextColor, 0.6),
selectedTextColor: rawTheme.palette.alternateTextColor,
},
textField: {
textColor: rawTheme.palette.textColor,
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const Tab = React.createClass({
textAlign: 'center',
verticalAlign: 'middle',
height: 48,
color: selected ? 'rgba(255,255,255,1)' : 'rgba(255,255,255,0.6)',
color: selected ? this.state.muiTheme.tabs.selectedTextColor : this.state.muiTheme.tabs.textColor,
outline: 'none',
fontSize: 14,
fontWeight: 500,
Expand Down

0 comments on commit 9ccc4e1

Please sign in to comment.