Skip to content

Commit

Permalink
Merge pull request #824 from gympass/DS-843
Browse files Browse the repository at this point in the history
[DS-843] - Typography typing
  • Loading branch information
matheushdsbr authored Jun 4, 2024
2 parents 50b7688 + 26289d4 commit c9af458
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/system/src/typography/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './typography';
export type { Typography } from './types';
28 changes: 28 additions & 0 deletions packages/system/src/typography/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { colors, fontSizes, lineHeights } from '@gympass/yoga-tokens';

type ColorsValues = typeof colors | string;
type FontSizesValues = typeof fontSizes | string | number;
type LineHeightsValues = typeof lineHeights | string | number;
type TextAlignValues = string;

type Color = {
color?: ColorsValues;
c?: ColorsValues;
};

type FontSize = {
fontSize?: FontSizesValues;
fs?: FontSizesValues;
};

type LineHeight = {
lineHeight?: LineHeightsValues;
lh?: LineHeightsValues;
};

type TextAlign = {
textAlign?: TextAlignValues;
ta?: TextAlignValues;
};

export type Typography = Color & FontSize & LineHeight & TextAlign;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
textTransform,
} from './typography';

import { fontWeight as fontWeightAndroid } from './font-weight/fontWeight.android';
import { fontWeight as fontWeightAndroid } from '../font-weight/fontWeight.android';

const fontSizes = [10, 20, 40];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { toPx } from './unit';
import { toPx } from '../unit';
import {
getFontSize,
getColor,
getLineHeight,
generator,
compose,
} from './theme';
} from '../theme';

import { fontWeight } from './font-weight';
import { fontWeight } from '../font-weight';

const color = props =>
generator({
Expand Down

0 comments on commit c9af458

Please sign in to comment.