mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
fix: pass-through to color / unset if no gradient
This commit is contained in:
2
external/lang
vendored
2
external/lang
vendored
Submodule external/lang updated: 58a9fb697d...1a85421661
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user