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

Access theme constants in your own source code. #81

Open
arfemia opened this issue May 21, 2021 · 1 comment
Open

Access theme constants in your own source code. #81

arfemia opened this issue May 21, 2021 · 1 comment

Comments

@arfemia
Copy link

arfemia commented May 21, 2021

All that needs to be done is adding the following to index.d.ts in expo-ui-kit/src:

...
export declare const theme: {
  COLORS: {
    font: string;
    primary: string;
    secondary: string;
    tertiary: string;
    black: string;
    white: string;
    gray: string;
    error: string;
    warning: string;
    success: string;
    info: string;
  },
  SIZES: {
    base: number;
    font: number;
    radius: number;
    padding: number;
    h1: number;
    h2: number;
    h3: number;
    title: number;
    subtitle: number;
    caption: number;
    small: number;
    width: number;
    height: number;
  },

  FONTS: {
    h1: {
      fontSize: number;
      letterSpacing: number;
    };
    h2: {
      fontSize: number;
      letterSpacing: number;
    };
    h3: {
      fontSize: number;
      letterSpacing: number;
    };
    title: {
      fontSize: number;
      letterSpacing: number;
    };
    subtitle: {
      fontSize: number;
    };
    caption: {
      fontSize: number;
      letterSpacing: number;
    };
    small: {
      fontSize: number;
      letterSpacing: number;
    };
  },

  WEIGHTS: {
    regular: string;
    bold: string;
    semibold: string;
    medium: string;
    light: string;
  }

}
...
@hetmann
Copy link
Contributor

hetmann commented May 22, 2021

Thank you for your feedback! I was thinking to rewrite expo-ui-kit using TS & publish it compiled :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants