Skip to content

Commit

Permalink
figured out className issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneeza committed Feb 13, 2025
1 parent e534a3f commit 8bc8b9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions packages/code/src/Code.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export const LiveExample: StoryType<typeof Code, FontSizeProps> = ({
highlightLines={highlightLines ? [6, [10, 15]] : undefined}
className={css`
width: 100%;
.lg-highlight-custom {
color: red;
}
`}
>
{jsSnippet}
Expand All @@ -167,6 +171,10 @@ export const CustomWord: StoryType<typeof Code, FontSizeProps> = ({
highlightLines={highlightLines ? [6, [10, 15]] : undefined}
className={css`
width: 100%;
.lg-highlight-custom {
color: red;
}
`}
>
{jsCustomSnippet}
Expand Down Expand Up @@ -195,13 +203,6 @@ export const WithCustomActions: StoryType<typeof Code, FontSizeProps> = ({
showCustomActionButtons
/>
}
//TODO: className is not working
className={css`
opacity: 0.5;
.lg-highlight-custom {
color: red;
}
`}
>
{jsSnippet}
</Code>
Expand Down
3 changes: 2 additions & 1 deletion packages/code/src/Code/Code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ function Code({
const { theme, darkMode } = useDarkMode(darkModeProp);
const baseFontSize = useBaseFontSize();

console.log({ className });

useIsomorphicLayoutEffect(() => {
const scrollableElement = scrollableElementRef.current;

Expand Down Expand Up @@ -233,7 +235,6 @@ function Code({
collapsedCodeHeight,
isMultiline,
showExpandButton,
className,
})}
onScroll={onScroll}
ref={scrollableElementRef}
Expand Down

0 comments on commit 8bc8b9f

Please sign in to comment.