fix: pass-through to color / unset if no gradient

This commit is contained in:
Paul Makles
2022-07-16 12:59:59 +01:00
parent 29718df94d
commit bd1bc79996
2 changed files with 14 additions and 6 deletions

2
external/lang vendored

View File

@@ -1,7 +1,7 @@
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { User, API } from "revolt.js"; import { User, API } from "revolt.js";
import styled from "styled-components/macro"; import styled, { css } from "styled-components/macro";
import { Ref } from "preact"; import { Ref } from "preact";
import { Text } from "preact-i18n"; import { Text } from "preact-i18n";
@@ -39,10 +39,18 @@ type UsernameProps = Omit<
}; };
const Name = styled.span<{ colour?: string | null }>` const Name = styled.span<{ colour?: string | null }>`
background: ${(props) => props.colour ?? "var(--foreground)"}; ${(props) =>
background-clip: text; props.colour &&
-webkit-background-clip: text; (props.colour.includes("gradient")
-webkit-text-fill-color: transparent; ? css`
background: ${props.colour};
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
`
: css`
color: ${props.colour};
`)}
`; `;
export const Username = observer( export const Username = observer(