Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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: 1 addition & 1 deletion packages/ui-components/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const preview: Preview = {

decorators: [
withThemeByDataAttribute<ReactRenderer>({
themes: { light: '', dark: 'dark' },
themes: { light: 'light', dark: 'dark' },
Comment thread
btea marked this conversation as resolved.
defaultTheme: 'light',
attributeName: 'data-theme',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
@apply bg-brand-600
text-white!;
}

/* Keep inline `code` readable in light theme, where hover/focus turns text white */
:where([data-theme='light'], [data-theme='light'] *)
&:is(:hover, :focus-visible)
code {
@apply text-brand-900;
}
}

.dropdownLabel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const SAMPLE_CHANGES = [
{
versions: ['v15.0.0', 'v14.17.0'],
label: 'Added in v15.0.0, v14.17.0',
content: (
<>
Added in: <code>v15.0.0</code>, <code>v14.17.0</code>
</>
),
url: 'https://github.com/nodejs/node/pull/67890',
},
{
Expand Down Expand Up @@ -107,9 +112,13 @@ const LARGE_SAMPLE_CHANGES = [

export const Default: Story = {
render: args => (
<div className="right-0 flex justify-end">
<ChangeHistory {...args} />
</div>
// `main` reproduces the docs page context: markdown.css scopes inline
// `code` styles under `main`, which is what the hover fix interacts with /ui-components/src/styles/markdown.css:85
Comment thread
mikeesto marked this conversation as resolved.
Outdated
<main>
<div className="flex justify-end">
<ChangeHistory {...args} />
</div>
</main>
),
args: {
changes: SAMPLE_CHANGES,
Expand All @@ -118,9 +127,11 @@ export const Default: Story = {

export const LargeHistory: Story = {
render: args => (
<div className="right-0 flex justify-end">
<ChangeHistory {...args} />
</div>
<main>
<div className="flex justify-end">
<ChangeHistory {...args} />
</div>
</main>
),
args: {
changes: LARGE_SAMPLE_CHANGES,
Expand Down
Loading