Skip to content

Commit adc5437

Browse files
authored
Add firefox specific styles to fix team section (#6580)
1 parent b8d2ec4 commit adc5437

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

packages/web/docs/src/components/team-section/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ function TeamAvatar({ data: [name, avatar, social] }: { data: TeamMember }) {
139139
rel="noreferrer"
140140
>
141141
<div className="relative aspect-square min-h-[var(--size)] w-auto min-w-[var(--size)] flex-1 overflow-hidden rounded-2xl mix-blend-multiply ring-blue-500/0 ring-offset-2 transition-all hover:ring-4 hover:ring-blue-500/15 group-focus:ring-blue-500/40 group-focus-visible:ring-4 xl:w-[var(--size)]">
142-
<div className="absolute inset-0 size-full bg-blue-100" />
142+
<div className="firefox:hidden absolute inset-0 size-full bg-blue-100" />
143143
<Image
144144
alt=""
145-
className="rounded-2xl bg-black brightness-100 grayscale transition-all duration-500 group-hover:scale-[1.03] group-hover:brightness-110"
145+
className="firefox:bg-blend-multiply firefox:![filter:grayscale(1)] rounded-2xl bg-black brightness-100 grayscale transition-all duration-500 group-hover:scale-[1.03] group-hover:brightness-110"
146146
{...(typeof avatar === 'string'
147147
? { src: avatar }
148148
: { blurDataURL: avatar.blurDataURL, src: avatar.src })}

packages/web/docs/tailwind.config.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const config: Config = {
4646
tailwindcssAnimate,
4747
blockquotesPlugin(),
4848
tailwindTypography,
49+
firefoxVariantPlugin(),
4950
],
5051
};
5152

@@ -88,3 +89,27 @@ function blockquotesPlugin() {
8889
);
8990
});
9091
}
92+
93+
function firefoxVariantPlugin() {
94+
return plugin((api: PluginAPI) => {
95+
const { addVariant, e, postcss } = api as PluginAPI & { postcss: any };
96+
// @ts-expect-error types are outdated
97+
addVariant('firefox', ({ container, separator }) => {
98+
if (!postcss || !container || !separator) {
99+
throw new Error("can't add firefox variant, assumptions invalid. did the API change?");
100+
}
101+
const isFirefoxRule = postcss.atRule({
102+
name: 'supports',
103+
params: '(-moz-appearance:none)',
104+
});
105+
isFirefoxRule.append(container.nodes);
106+
container.append(isFirefoxRule);
107+
// @ts-expect-error types are outdated
108+
isFirefoxRule.walkRules(rule => {
109+
rule.selector = `.${e(
110+
`firefox${separator}${rule.selector.slice(1).replaceAll('\\', '')}`,
111+
)}`;
112+
});
113+
});
114+
});
115+
}

0 commit comments

Comments
 (0)