From 9d94432a2af5237cd58b4d674162e0ce1b82895e Mon Sep 17 00:00:00 2001 From: Pavel Pomerantsev Date: Sat, 9 May 2015 22:27:25 +0300 Subject: [PATCH] Consistently use contentFontFamily as a theme property Fixes #619. --- src/styles/theme-manager.js | 4 ++-- src/styles/themes/light-theme.js | 2 +- src/tabs/tab.jsx | 6 +----- src/tooltip.jsx | 8 ++++++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/styles/theme-manager.js b/src/styles/theme-manager.js index dbddfaf90fec3b..9283bcdf9f8e45 100644 --- a/src/styles/theme-manager.js +++ b/src/styles/theme-manager.js @@ -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()), @@ -40,4 +40,4 @@ var ThemeManager = function() { }; }; -module.exports = ThemeManager; \ No newline at end of file +module.exports = ThemeManager; diff --git a/src/styles/themes/light-theme.js b/src/styles/themes/light-theme.js index 55bc4071580b7f..2ef0aab7eaef00 100644 --- a/src/styles/themes/light-theme.js +++ b/src/styles/themes/light-theme.js @@ -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, diff --git a/src/tabs/tab.jsx b/src/tabs/tab.jsx index 8cdda302bf2e12..df341c10182636 100644 --- a/src/tabs/tab.jsx +++ b/src/tabs/tab.jsx @@ -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', @@ -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); diff --git a/src/tooltip.jsx b/src/tooltip.jsx index ec6ac425853bd8..f1ce8f7b0b44b1 100644 --- a/src/tooltip.jsx +++ b/src/tooltip.jsx @@ -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, @@ -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', @@ -125,4 +129,4 @@ var Tooltip = React.createClass({ }); -module.exports = Tooltip; \ No newline at end of file +module.exports = Tooltip;