Skip to content

Commit 50a2e87

Browse files
authored
Merge pull request #947 from rpearce/docs/support-dark-bg
docs: support dark bg
2 parents e01ceee + 3a31e41 commit 50a2e87

File tree

5 files changed

+69
-29
lines changed

5 files changed

+69
-29
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,15 @@
902902
"ideas",
903903
"review"
904904
]
905+
},
906+
{
907+
"login": "Akhileswar6",
908+
"name": "Akhileswar Kamale",
909+
"avatar_url": "https://avatars.githubusercontent.com/u/159161616?v=4",
910+
"profile": "https://github.com/Akhileswar6",
911+
"contributions": [
912+
"bug"
913+
]
905914
}
906915
],
907916
"repoType": "github",

.storybook/preview.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React from 'react'
2+
import type { StoryContext } from '@storybook/react-webpack5'
3+
4+
const BackgroundWrapper = ({
5+
children,
6+
context,
7+
}: {
8+
children: React.ReactNode,
9+
context: StoryContext,
10+
}) => {
11+
const bg = context.globals.backgrounds.value ?? 'light'
12+
13+
return <div className={`bg-${bg}`}>{children}</div>
14+
}
15+
16+
export const decorators = [
17+
(Story: () => React.JSX.Element, context: StoryContext) => (
18+
<BackgroundWrapper context={context}>
19+
<Story />
20+
</BackgroundWrapper>
21+
),
22+
]
23+
24+
export const parameters = {
25+
options: {
26+
showPanel: false,
27+
storySort: {
28+
order: [
29+
'Introduction',
30+
'Galleries',
31+
'*',
32+
'<img>',
33+
'*',
34+
'<svg>',
35+
'*',
36+
'<picture>',
37+
'*',
38+
'<figure>',
39+
'*',
40+
'Custom Controls',
41+
'*',
42+
],
43+
},
44+
},
45+
previewTabs: {
46+
'storybook/docs/panel': {
47+
hidden: true,
48+
},
49+
},
50+
} as const

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-medium-image-zoom
22

3-
[![npm version](https://img.shields.io/npm/v/react-medium-image-zoom.svg)](https://www.npmjs.com/package/react-medium-image-zoom) [![react-medium-image-zoom bundlejs badge](https://deno.bundlejs.com/?q=react-medium-image-zoom&badge=&config={%22esbuild%22:{%22external%22:[%22react%22,%22react-dom%22]}})](https://bundlejs.com/?q=react-medium-image-zoom) [![npm downloads](https://img.shields.io/npm/dm/react-medium-image-zoom.svg)](https://www.npmjs.com/package/react-medium-image-zoom) [![All Contributors](https://img.shields.io/badge/all_contributors-91-orange.svg)](#contributors-)
3+
[![npm version](https://img.shields.io/npm/v/react-medium-image-zoom.svg)](https://www.npmjs.com/package/react-medium-image-zoom) [![react-medium-image-zoom bundlejs badge](https://deno.bundlejs.com/?q=react-medium-image-zoom&badge=&config={%22esbuild%22:{%22external%22:[%22react%22,%22react-dom%22]}})](https://bundlejs.com/?q=react-medium-image-zoom) [![npm downloads](https://img.shields.io/npm/dm/react-medium-image-zoom.svg)](https://www.npmjs.com/package/react-medium-image-zoom) [![All Contributors](https://img.shields.io/badge/all_contributors-92-orange.svg)](#contributors-)
44

55
The original [medium.com-inspired image zooming](https://medium.design/image-zoom-on-medium-24d146fc0c20)
66
library for [React](https://reactjs.org).
@@ -485,6 +485,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
485485
<td align="center" valign="top" width="14.28%"><a href="https://github.com/napstar-420"><img src="https://avatars.githubusercontent.com/u/100934169?v=4?s=40" width="40px;" alt="Zohaib Khan"/><br /><sub><b>Zohaib Khan</b></sub></a><br /><a href="https://github.com/rpearce/react-medium-image-zoom/commits?author=napstar-420" title="Code">💻</a> <a href="#example-napstar-420" title="Examples">💡</a></td>
486486
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rdestefa"><img src="https://avatars.githubusercontent.com/u/67760716?v=4?s=40" width="40px;" alt="Ryan DeStefano"/><br /><sub><b>Ryan DeStefano</b></sub></a><br /><a href="#ideas-rdestefa" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/rpearce/react-medium-image-zoom/pulls?q=is%3Apr+reviewed-by%3Ardestefa" title="Reviewed Pull Requests">👀</a></td>
487487
</tr>
488+
<tr>
489+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Akhileswar6"><img src="https://avatars.githubusercontent.com/u/159161616?v=4?s=40" width="40px;" alt="Akhileswar Kamale"/><br /><sub><b>Akhileswar Kamale</b></sub></a><br /><a href="https://github.com/rpearce/react-medium-image-zoom/issues?q=author%3AAkhileswar6" title="Bug reports">🐛</a></td>
490+
</tr>
488491
</tbody>
489492
</table>
490493

stories/base.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ body {
2121
font-size: 1.6rem;
2222
font-family: monospace;
2323
line-height: 1.5;
24-
color: #333;
2524
}
2625
body,
2726
input,
@@ -41,6 +40,12 @@ img {
4140
display: block;
4241
max-width: 100%;
4342
}
43+
.bg-dark {
44+
color: #fff;
45+
}
46+
.bg-light {
47+
color: #333;
48+
}
4449
.display-none {
4550
display: none;
4651
}

0 commit comments

Comments
 (0)