Skip to content

Commit d4e9978

Browse files
author
Hector Arce De Las Heras
committed
Improve getStyles method
1 parent d71a554 commit d4e9978

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/types/styles/position.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export type PositionTypes = {
77
float?: string;
88
transform?: string;
99
transform_style?: string;
10+
translate?: string;
1011
z_index?: number;
1112
};

src/utils/getStyles/getStyles.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,30 @@ export const getPositionStyles = (prop?: PositionTypes): CSSProp => {
337337
if (!prop) {
338338
return css``;
339339
}
340-
const { position, top, right, bottom, left, float, transform, z_index, transform_style } = prop;
340+
const {
341+
position,
342+
top,
343+
right,
344+
bottom,
345+
left,
346+
float,
347+
transform,
348+
z_index,
349+
transform_style,
350+
translate,
351+
} = prop;
341352

342353
return css`
343354
${position && `position: ${position};`}
344355
${transform_style && `transform-style: ${transform_style};`}
345356
${top && `top: ${top};`}
346-
${right && `right: ${right};`}
347-
${bottom && `bottom: ${bottom};`}
348-
${left && `left: ${left};`}
349-
${float && `float: ${float};`}
350-
${transform && `transform: ${transform};`}
351-
${z_index && `z-index: ${z_index};`}
357+
${right && `right: ${right};`}
358+
${bottom && `bottom: ${bottom};`}
359+
${left && `left: ${left};`}
360+
${float && `float: ${float};`}
361+
${transform && `transform: ${transform};`}
362+
${z_index && `z-index: ${z_index};`}
363+
${translate && `translate: ${translate};`}
352364
`;
353365
};
354366

0 commit comments

Comments
 (0)