styled-components#CSSProp TypeScript Examples
The following examples show how to use
styled-components#CSSProp.
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: Tooltip.tsx From convoychat with GNU General Public License v3.0 | 6 votes |
fourCarets: Record<
Extract<PLACEMENTS, "top" | "left" | "bottom" | "right">,
CSSProp
> = {
top: css`
${caret};
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid ${p => p.theme.colors.gray};
top: 100%;
`,
bottom: css`
${caret};
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid ${p => p.theme.colors.gray};
bottom: 100%;
`,
left: css`
${caret};
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid ${p => p.theme.colors.gray};
left: 100%;
`,
right: css`
${caret};
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid ${p => p.theme.colors.gray};
right: 100%;
`,
}
Example #2
Source File: Tooltip.tsx From convoychat with GNU General Public License v3.0 | 6 votes |
carets: Record<PLACEMENTS, CSSProp> = {
...fourCarets,
"bottom-left": css`
${caret};
${fourCarets.bottom};
`,
"top-left": css`
${caret};
${fourCarets.top};
`,
}
Example #3
Source File: SocialLink.tsx From convoychat with GNU General Public License v3.0 | 6 votes |
SocialLinkStyles: Record<ILinkTypes, CSSProp> = {
twitter: css`
background-color: #00acee;
`,
github: css`
background-color: white;
color: ${p => p.theme.colors.dark3};
`,
instagram: css`
background-color: #d72978;
`,
website: css`
background-color: white;
color: ${p => p.theme.colors.dark3};
`,
}