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

Add light-mobile theme with text overrides #11325

Closed
wants to merge 2 commits into from

Conversation

aaronccasanova
Copy link
Member

@aaronccasanova aaronccasanova commented Dec 12, 2023

WIP to enable variable Inter font-weights in React Native. TL;DR React Native doesn't support setting custom font-weights (such as 450, 550, and 650), however, we can potentially work around this limitation by:

  • Exporting new font assets at the desired weights
  • Adding them to the React Native stylesheet, and
  • Overriding the text variant font-familys to include the custom weight in the name
    e.g. font-family: Inter becomes font-family: Inter-450

Example usage

import {AppProvider} from '@shopify/polaris';
import {themes} from '@shopify/polaris-tokens';

const theme = themes['light-mobile'];

const styles = StyleSheet.create({
  text: {
    fontFamily: theme.text['text-heading-lg-font-family'], // 'Inter-650'
    fontSize: theme.text['text-heading-lg-font-size'],
  },
});

const App = () => (
  <AppProvider theme="light-mobile">
    <Text style={styles.text}>Hello</Text>
  </AppProvider>
);

@aaronccasanova
Copy link
Member Author

/snapit

Copy link
Contributor

🫰✨ Thanks @aaronccasanova! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@aaronccasanova aaronccasanova changed the title Add light-mobile theme with text token groups overrides Add light-mobile theme with text overrides Dec 12, 2023
@aaronccasanova aaronccasanova force-pushed the mobile-variable-font-weights branch from 85fca3e to 68ccdb7 Compare April 19, 2024 21:52
@github-actions github-actions bot added the cla-needed Added by a bot. Contributor needs to sign the CLA Agreement. label Apr 19, 2024
Copy link
Contributor

Hi! We noticed there hasn’t been activity on this PR in a while. After 30 days, it will close automatically.

If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-needed Added by a bot. Contributor needs to sign the CLA Agreement. no-pr-activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant