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

Making card-text pull its text color from the theme #1995

Merged
merged 2 commits into from
Oct 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May introduce a little breaking change. But I think it's fine.

outline: 'none',
fontSize: 14,
fontWeight: 500,
Expand Down