mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-12 10:19:59 -05:00
fix: pass-through to color / unset if no gradient
This commit is contained in:
parent
73fd35bf46
commit
dbe8a64ffc
2 changed files with 14 additions and 6 deletions
2
external/lang
vendored
2
external/lang
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 58a9fb697de00f570d445be4d12e3ce4a5e3522e
|
Subproject commit 1a8542166173445602c0a4a8f821806002fd2fc4
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue