Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InlineLinks inherit text size even with custom css #465

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/react/src/InlineLink/InlineLink.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

.InlineLink,
.InlineLink > span {
font-size: inherit;
line-height: inherit;
font-weight: inherit;
color: var(--brand-InlineLink-color-rest);
}
Expand Down
22 changes: 22 additions & 0 deletions packages/react/src/InlineLink/InlineLink.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,25 @@ export const SizeInheritence = () => (
</Text>
</>
)

export const SizeInheritenceWithCustomCSS = () => (
<>
<style
dangerouslySetInnerHTML={{
__html: `
.custom-css p {
margin-bottom: 32px;
font-size: 32px;
line-height: 28px;
}
`,
}}
/>
<div className="custom-css">
<Text as="p">
The size of the following link will be inherited from the parent, without the need for specifying additional
`size` parameters. <InlineLink href="#">condimentum nulla donec blandit</InlineLink>.
</Text>
</div>
</>
)
9 changes: 9 additions & 0 deletions packages/react/src/InlineLink/InlineLink.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@ test.describe('Visual Comparison: InlineLink', () => {
await page.waitForTimeout(500)
expect(await page.screenshot()).toMatchSnapshot()
})

test('InlineLink / Size Inheritence With Custom CSS', async ({page}) => {
await page.goto(
'http://localhost:6006/iframe.html?args=&id=components-inlinelink--size-inheritence-with-custom-css&viewMode=story',
)

await page.waitForTimeout(500)
expect(await page.screenshot()).toMatchSnapshot()
})
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a regression on the size prop?

Screen.Recording.2023-10-17.at.09.51.51.mov

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.