Reverted changes to normalize font size (#1489)

This commit is contained in:
Harrison Healey
2018-03-07 16:35:44 +00:00
committed by Elias Nahum
parent 6293d3d5e4
commit 84db6d0974
2 changed files with 22 additions and 29 deletions

View File

@@ -20,7 +20,7 @@ import OptionsContext from 'app/components/options_context';
import PostBodyAdditionalContent from 'app/components/post_body_additional_content';
import {emptyFunction} from 'app/utils/general';
import {getMarkdownTextStyles, getMarkdownBlockStyles, normalizeFontSizeByDevice} from 'app/utils/markdown';
import {getMarkdownTextStyles, getMarkdownBlockStyles} from 'app/utils/markdown';
import {makeStyleSheetFromTheme} from 'app/utils/theme';
import Reactions from 'app/components/reactions';
@@ -314,8 +314,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
message: {
color: theme.centerChannelColor,
fontSize: normalizeFontSizeByDevice(13),
lineHeight: normalizeFontSizeByDevice(16),
fontSize: 15,
lineHeight: 20,
},
messageContainerWithReplyBar: {
flexDirection: 'row',

View File

@@ -1,20 +1,13 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {Dimensions, PixelRatio, Platform, StyleSheet} from 'react-native';
import {Platform, StyleSheet} from 'react-native';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
export function getCodeFont() {
return Platform.OS === 'ios' ? 'Menlo' : 'monospace';
}
const portraitWidth = Dimensions.get('window').width <= Dimensions.get('window').height ? Dimensions.get('window').width : Dimensions.get('window').height;
const scale = portraitWidth / 320;
export const normalizeFontSizeByDevice = (size) => {
return Math.ceil(PixelRatio.roundToNearestPixel(size * scale));
};
export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => {
const codeFont = getCodeFont();
@@ -32,52 +25,52 @@ export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => {
color: theme.linkColor,
},
heading1: {
fontSize: normalizeFontSizeByDevice(16),
fontSize: 17,
fontWeight: '700',
lineHeight: normalizeFontSizeByDevice(22),
lineHeight: 25,
},
heading1Text: {
paddingBottom: normalizeFontSizeByDevice(6),
paddingBottom: 8,
},
heading2: {
fontSize: normalizeFontSizeByDevice(16),
fontSize: 17,
fontWeight: '700',
lineHeight: normalizeFontSizeByDevice(22),
lineHeight: 25,
},
heading2Text: {
paddingBottom: normalizeFontSizeByDevice(6),
paddingBottom: 8,
},
heading3: {
fontSize: normalizeFontSizeByDevice(16),
fontSize: 17,
fontWeight: '700',
lineHeight: normalizeFontSizeByDevice(22),
lineHeight: 25,
},
heading3Text: {
paddingBottom: normalizeFontSizeByDevice(6),
paddingBottom: 8,
},
heading4: {
fontSize: normalizeFontSizeByDevice(16),
fontSize: 17,
fontWeight: '700',
lineHeight: normalizeFontSizeByDevice(22),
lineHeight: 25,
},
heading4Text: {
paddingBottom: normalizeFontSizeByDevice(6),
paddingBottom: 8,
},
heading5: {
fontSize: normalizeFontSizeByDevice(16),
fontSize: 17,
fontWeight: '700',
lineHeight: normalizeFontSizeByDevice(22),
lineHeight: 25,
},
heading5Text: {
paddingBottom: normalizeFontSizeByDevice(6),
paddingBottom: 8,
},
heading6: {
fontSize: normalizeFontSizeByDevice(16),
fontSize: 17,
fontWeight: '700',
lineHeight: normalizeFontSizeByDevice(22),
lineHeight: 25,
},
heading6Text: {
paddingBottom: normalizeFontSizeByDevice(6),
paddingBottom: 8,
},
code: {
alignSelf: 'center',