Skip to content

Access theme constants in your own source code. #81

@arfemia

Description

@arfemia

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;
  }

}
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions