Skip to content

Commit 9ccc4e1

Browse files
Merge pull request mui#1995 from KaeruCT/cardTextTextColor
[Theme] Making card-text pull its text color from the theme
2 parents aa7e541 + 83c610f commit 9ccc4e1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/card/card-text.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const CardText = React.createClass({
2525
},
2626

2727
getInitialState() {
28-
return {
28+
return {
2929
muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),
3030
};
3131
},
@@ -44,18 +44,13 @@ const CardText = React.createClass({
4444
actAsExpander: React.PropTypes.bool,
4545
},
4646

47-
getDefaultProps() {
48-
return {
49-
color: Styles.Colors.ck,
50-
};
51-
},
52-
5347
getStyles() {
48+
const themeVariables = this.state.muiTheme.cardText;
5449
return {
5550
root: {
5651
padding: 16,
5752
fontSize: '14px',
58-
color: this.props.color,
53+
color: this.props.color ? this.props.color : themeVariables.textColor,
5954
},
6055
};
6156
},

src/styles/theme-manager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module.exports = {
2121
minWidth: 88,
2222
iconButtonSize: rawTheme.spacing.iconSize * 2,
2323
},
24+
cardText: {
25+
textColor: rawTheme.palette.textColor,
26+
},
2427
checkbox: {
2528
boxColor: rawTheme.palette.textColor,
2629
checkedColor: rawTheme.palette.primary1Color,
@@ -180,6 +183,8 @@ module.exports = {
180183
},
181184
tabs: {
182185
backgroundColor: rawTheme.palette.primary1Color,
186+
textColor: ColorManipulator.fade(rawTheme.palette.alternateTextColor, 0.6),
187+
selectedTextColor: rawTheme.palette.alternateTextColor,
183188
},
184189
textField: {
185190
textColor: rawTheme.palette.textColor,

src/tabs/tab.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const Tab = React.createClass({
6868
textAlign: 'center',
6969
verticalAlign: 'middle',
7070
height: 48,
71-
color: selected ? 'rgba(255,255,255,1)' : 'rgba(255,255,255,0.6)',
71+
color: selected ? this.state.muiTheme.tabs.selectedTextColor : this.state.muiTheme.tabs.textColor,
7272
outline: 'none',
7373
fontSize: 14,
7474
fontWeight: 500,

0 commit comments

Comments
 (0)