Skip to content

Commit

Permalink
Merge pull request #621 from pomerantsev/fix/font-family
Browse files Browse the repository at this point in the history
Consistently use contentFontFamily as a theme property
  • Loading branch information
Hai Nguyen committed May 10, 2015
2 parents 985fe8b + 9d94432 commit 9b9f222
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/styles/theme-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var ThemeManager = function() {
template: Types.LIGHT,

spacing: Spacing,
fontFamily: 'Roboto, sans-serif',
contentFontFamily: 'Roboto, sans-serif',

palette: Types.LIGHT.getPalette(),
component: Types.LIGHT.getComponentThemes(Types.LIGHT.getPalette()),
Expand All @@ -40,4 +40,4 @@ var ThemeManager = function() {
};
};

module.exports = ThemeManager;
module.exports = ThemeManager;
2 changes: 1 addition & 1 deletion src/styles/themes/light-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var ColorManipulator = require('../../utils/color-manipulator');

var LightTheme = {
spacing: Spacing,
fontFamily: 'Roboto, sans-serif',
contentFontFamily: 'Roboto, sans-serif',
getPalette: function() {
return {
primary1Color: Colors.cyan500,
Expand Down
6 changes: 1 addition & 5 deletions src/tabs/tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ var Tab = React.createClass({
this.props.handleTouchTap(this.props.tabIndex, this);
},

getTheme: function() {
return this.context.muiTheme.palette;
},

render: function(){
var styles = this.mergeAndPrefix({
'display': 'table-cell',
Expand All @@ -36,7 +32,7 @@ var Tab = React.createClass({
'fontSize': '14sp',
'fontWeight': '500',
'whiteSpace': 'initial',
'font': this.getTheme().fontFamily,
fontFamily: this.context.muiTheme.contentFontFamily,
'width': this.props.width
}, this.props.style);

Expand Down
8 changes: 6 additions & 2 deletions src/tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ var Tooltip = React.createClass({

mixins: [StylePropable],

contextTypes: {
muiTheme: React.PropTypes.object
},

propTypes: {
className: React.PropTypes.string,
label: React.PropTypes.string.isRequired,
Expand All @@ -26,7 +30,7 @@ var Tooltip = React.createClass({
var styles = {
root: {
position: 'absolute',
fontFamily: "'Roboto'",
fontFamily: this.context.muiTheme.contentFontFamily,
fontSize: '10px',
lineHeight: '22px',
padding: '0 8px',
Expand Down Expand Up @@ -125,4 +129,4 @@ var Tooltip = React.createClass({

});

module.exports = Tooltip;
module.exports = Tooltip;

0 comments on commit 9b9f222

Please sign in to comment.