Deprecate need for revert-layer CSS (#37632)

This commit is contained in:
Echo
2026-01-27 15:45:35 +01:00
committed by GitHub
parent 9ea64fcb5a
commit 76ab866d93
6 changed files with 17 additions and 13 deletions

View File

@@ -13,6 +13,7 @@ interface Props extends React.SVGProps<SVGSVGElement> {
children?: never; children?: never;
id: string; id: string;
icon: IconProp; icon: IconProp;
noFill?: boolean;
} }
export const Icon: React.FC<Props> = ({ export const Icon: React.FC<Props> = ({
@@ -20,6 +21,7 @@ export const Icon: React.FC<Props> = ({
icon: IconComponent, icon: IconComponent,
className, className,
'aria-label': ariaLabel, 'aria-label': ariaLabel,
noFill = false,
...other ...other
}) => { }) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -42,7 +44,12 @@ export const Icon: React.FC<Props> = ({
return ( return (
<IconComponent <IconComponent
className={classNames('icon', `icon-${id}`, className)} className={classNames(
'icon',
`icon-${id}`,
noFill && 'icon--no-fill',
className,
)}
title={title} title={title}
aria-hidden={ariaHidden} aria-hidden={ariaHidden}
aria-label={ariaLabel} aria-label={ariaLabel}

View File

@@ -37,7 +37,12 @@ export const AccountBadges: FC<{ accountId: string }> = ({ accountId }) => {
let icon: ReactNode = undefined; let icon: ReactNode = undefined;
if (isAdminBadge(role)) { if (isAdminBadge(role)) {
icon = ( icon = (
<Icon icon={IconAdmin} id='badge-admin' className={classes.badgeIcon} /> <Icon
icon={IconAdmin}
id='badge-admin'
className={classes.badgeIcon}
noFill
/>
); );
} }
badges.push( badges.push(

View File

@@ -76,6 +76,7 @@ const RedesignAccountHeaderFields: FC<{ account: Account }> = ({ account }) => {
id='verified' id='verified'
icon={IconVerified} icon={IconVerified}
className={classes.fieldIconVerified} className={classes.fieldIconVerified}
noFill
/> />
)} )}
</> </>

View File

@@ -81,6 +81,7 @@ export const AccountFieldsModal: FC<{
id='verified' id='verified'
icon={IconVerified} icon={IconVerified}
className={classes.fieldIconVerified} className={classes.fieldIconVerified}
noFill
/> />
)} )}
</dd> </dd>

View File

@@ -53,11 +53,6 @@ h1.name > small {
svg.badgeIcon { svg.badgeIcon {
opacity: 1; opacity: 1;
fill: revert-layer;
path {
fill: revert-layer;
}
} }
.fieldList { .fieldList {
@@ -90,11 +85,6 @@ svg.badgeIcon {
.fieldIconVerified { .fieldIconVerified {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
// Need to override .icon path.
path {
fill: revert-layer;
}
} }
.fieldNumbersWrapper { .fieldNumbersWrapper {

View File

@@ -275,7 +275,7 @@
height: 24px; height: 24px;
aspect-ratio: 1; aspect-ratio: 1;
path { &:not(.icon--no-fill) path {
fill: currentColor; fill: currentColor;
} }
} }