Skip to content

Commit

Permalink
Allow for BoxVariant to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Feb 21, 2022
1 parent 8626cda commit fa85133
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/style-engine/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*/
import type { CSSProperties } from 'react';

type BoxVariants = 'margin' | 'padding';
export type Box< T extends BoxVariants = 'margin' > = {
top?: CSSProperties[ `${ T }Top` ];
right?: CSSProperties[ `${ T }Right` ];
bottom?: CSSProperties[ `${ T }Bottom` ];
left?: CSSProperties[ `${ T }Left` ];
type BoxVariants = 'margin' | 'padding' | undefined;
export type Box< T extends BoxVariants = undefined > = {
top?: CSSProperties[ T extends undefined ? 'top' : `${ T }Top` ];
right?: CSSProperties[ T extends undefined ? 'right' : `${ T }Right` ];
bottom?: CSSProperties[ T extends undefined ? 'bottom' : `${ T }Bottom` ];
left?: CSSProperties[ T extends undefined ? 'left' : `${ T }Left` ];
};

export interface Style {
Expand Down

0 comments on commit fa85133

Please sign in to comment.