theme-ui#SxStyleProp TypeScript Examples
The following examples show how to use
theme-ui#SxStyleProp.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx From livepeer-com with MIT License | 5 votes |
baseSx: SxStyleProp = {
position: "relative",
}
Example #2
Source File: index.tsx From livepeer-com with MIT License | 5 votes |
TableCell: FunctionComponent<TableCellProps> = (props) => {
const { children, selected, variant } = props;
let sx = {
...props.sx,
backgroundColor: "transparent",
py: 3,
px: 4,
display: "flex",
alignItems: "center",
fontSize: 1,
} as SxStyleProp;
if (selected) {
// @ts-ignore
sx = {
...sx,
};
}
if (variant === TableRowVariant.Header) {
sx = {
...sx,
textTransform: "uppercase",
bg: "rgba(0,0,0,.03)",
borderBottom: "1px solid",
borderTop: "1px solid",
borderColor: "muted",
fontSize: 0,
color: "gray",
py: 2,
"&:first-of-type": {
borderLeft: "1px solid",
borderColor: "muted",
borderTopLeftRadius: 6,
borderBottomLeftRadius: 6,
},
"&:last-of-type": {
borderRight: "1px solid",
borderColor: "muted",
borderTopRightRadius: 6,
borderBottomRightRadius: 6,
},
};
} else if (variant === TableRowVariant.Normal) {
sx = {
...sx,
borderBottomColor: "muted",
borderBottomWidth: "1px",
borderBottomStyle: "solid",
};
} else if (variant === TableRowVariant.ComplexTop) {
sx = {
...sx,
paddingBottom: 0,
};
} else if (variant === TableRowVariant.ComplexMiddle) {
sx = {
...sx,
paddingBottom: 0,
paddingTop: 0,
};
} else if (variant === TableRowVariant.ComplexBottom) {
sx = {
...sx,
paddingTop: 0,
borderBottomColor: "muted",
borderBottomWidth: "1px",
borderBottomStyle: "solid",
};
}
return <Box sx={sx}>{children}</Box>;
}