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

Fix Android font weight issue #275

Merged
merged 4 commits into from
Jun 23, 2021
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
2 changes: 1 addition & 1 deletion packages/yoga/src/Text/native/Text.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import styled from 'styled-components';
import { oneOf, bool } from 'prop-types';
import textStyle from '../sharedTextStyle';
import textStyle from '../textStyle';

const styledText = type => styled.Text`
${textStyle(type)}
Expand Down
9 changes: 6 additions & 3 deletions packages/yoga/src/Text/textStyle.android.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from 'styled-components';
import defaultStyle from './textStyle';
import defaultStyle from './sharedTextStyle';

const textStyle = type => () => css`
${defaultStyle(type)};
Expand All @@ -17,8 +17,11 @@ const textStyle = type => () => css`
},
},
}) => `
${fontWeight !== 400 ? `-${fontWeight}` : ''};
${light ? `font-family: ${baseFont.family}-${fontWeights.light};` : ''}
font-family: ${
fontWeight === 400 ? baseFont.family : `${baseFont.family}-${fontWeight}`
};

${light ? `font-family: ${baseFont.family}-${fontWeights.light};` : ''}
`}
`;

Expand Down