Skip to content

Commit

Permalink
Keep firefox highlight fix className on the HighlightDecoration (v9) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hasparus authored Jan 24, 2025
1 parent 8fc2c3b commit 8f334d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/neat-pears-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@theguild/components": patch
---

Keep firefox highlight fix className on the HighlightDecoration (v9)
8 changes: 7 additions & 1 deletion packages/components/src/components/decorations/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { cn } from '../../cn';
import { ReactComponent as HighlightDecorationSvg } from './highlight-decoration.svg';

export { ReactComponent as ArchDecoration } from './arch-decoration.svg';
export { ReactComponent as ArchDecorationGradientDefs } from './arch-decoration-gradient-defs.svg';
export { ReactComponent as HighlightDecoration } from './highlight-decoration.svg';
export { ReactComponent as LargeHiveIconDecoration } from './large-hive-icon-decoration.svg';

export type DecorationIsolationProps = React.HTMLAttributes<HTMLDivElement>;
Expand All @@ -18,3 +18,9 @@ export function DecorationIsolation(props: DecorationIsolationProps) {
/>
);
}

// Components created from .svg import don't preserve className
export const HighlightDecoration = (props: React.SVGProps<SVGSVGElement>) => (
// eslint-disable-next-line tailwindcss/no-custom-classname
<HighlightDecorationSvg {...props} className={cn(props.className, 'firefox-highlight-fix')} />
);

0 comments on commit 8f334d9

Please sign in to comment.