aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/ui/text.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-07 07:59:16 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-07 07:59:16 +0800
commit10da1e24e13b728c2837e5360a48fcb2913855a5 (patch)
tree6e2421617a5ac499ea1224ba50b99120dc6b2ca0 /packages/instant/src/components/ui/text.tsx
parent42c441fafa0a0c2de45904a2f67293152dd954b2 (diff)
downloaddexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.tar
dexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.tar.gz
dexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.tar.bz2
dexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.tar.lz
dexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.tar.xz
dexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.tar.zst
dexon-sol-tools-10da1e24e13b728c2837e5360a48fcb2913855a5.zip
feat: make instant resistant to external styles
Diffstat (limited to 'packages/instant/src/components/ui/text.tsx')
-rw-r--r--packages/instant/src/components/ui/text.tsx52
1 files changed, 22 insertions, 30 deletions
diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx
index cba6e7b20..c6a76ff18 100644
--- a/packages/instant/src/components/ui/text.tsx
+++ b/packages/instant/src/components/ui/text.tsx
@@ -27,25 +27,28 @@ export const Text =
styled.div <
TextProps >
`
- font-family: ${props => props.fontFamily};
- font-style: ${props => props.fontStyle};
- font-weight: ${props => props.fontWeight};
- font-size: ${props => props.fontSize};
- opacity: ${props => props.opacity};
- text-decoration-line: ${props => props.textDecorationLine};
- ${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')};
- ${props => (props.center ? 'text-align: center' : '')};
- color: ${props => props.fontColor && props.theme[props.fontColor]};
- ${props => (props.minHeight ? `min-height: ${props.minHeight}` : '')};
- ${props => (props.onClick ? 'cursor: pointer' : '')};
- transition: color 0.5s ease;
- ${props => (props.noWrap ? 'white-space: nowrap' : '')};
- ${props => (props.display ? `display: ${props.display}` : '')};
- ${props => (props.letterSpacing ? `letter-spacing: ${props.letterSpacing}` : '')};
- ${props => (props.textTransform ? `text-transform: ${props.textTransform}` : '')};
- &:hover {
- ${props =>
- props.onClick ? `color: ${darken(darkenOnHoverAmount, props.theme[props.fontColor || 'white'])}` : ''};
+ && {
+ all: initial;
+ font-family: 'Inter UI', sans-serif;
+ font-style: ${props => props.fontStyle};
+ font-weight: ${props => props.fontWeight};
+ font-size: ${props => props.fontSize};
+ opacity: ${props => props.opacity};
+ text-decoration-line: ${props => props.textDecorationLine};
+ ${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')};
+ ${props => (props.center ? 'text-align: center' : '')};
+ color: ${props => props.fontColor && props.theme[props.fontColor]};
+ ${props => (props.minHeight ? `min-height: ${props.minHeight}` : '')};
+ ${props => (props.onClick ? 'cursor: pointer' : '')};
+ transition: color 0.5s ease;
+ ${props => (props.noWrap ? 'white-space: nowrap' : '')};
+ ${props => (props.display ? `display: ${props.display}` : '')};
+ ${props => (props.letterSpacing ? `letter-spacing: ${props.letterSpacing}` : '')};
+ ${props => (props.textTransform ? `text-transform: ${props.textTransform}` : '')};
+ &:hover {
+ ${props =>
+ props.onClick ? `color: ${darken(darkenOnHoverAmount, props.theme[props.fontColor || 'white'])}` : ''};
+ }
}
`;
@@ -61,14 +64,3 @@ Text.defaultProps = {
};
Text.displayName = 'Text';
-
-export const Title: React.StatelessComponent<TextProps> = props => <Text {...props} />;
-
-Title.defaultProps = {
- fontSize: '20px',
- fontWeight: 600,
- opacity: 1,
- fontColor: ColorOption.primaryColor,
-};
-
-Title.displayName = 'Title';