Skip to content

Commit dec09cf

Browse files
authored
feat(themes): add desktopBackground prop to all themes (#238)
* feat(themes): map Windows theme Background to desktopBackground theme prop * feat(themes): add desktopBackground prop to themes by tPenguinLTG * feat(themes): add desktopBackground prop to Windows-inspired themes Use colors from original Windows theme. * feat(themes): add desktopBackground prop to all other themes Use placeholder #008080 (teal) until more background colours are designed. * feat(themes): add desktopBackground prop to docz default theme * feat(themes): use desktopBackground theme prop where appropriate Create a styled Wrapper component that consumes the theme and uses the desktopBackground prop.
1 parent 7a0e081 commit dec09cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+136
-127
lines changed

src/AppBar/AppBar.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import styled from 'styled-components';
23
import {
34
AppBar,
45
Toolbar,
@@ -13,19 +14,12 @@ import logoIMG from '../assets/images/logo.png';
1314
export default {
1415
title: 'AppBar',
1516
component: AppBar,
16-
decorators: [
17-
story => (
18-
<div
19-
style={{
20-
padding: '5rem',
21-
background: 'teal'
22-
}}
23-
>
24-
{story()}
25-
</div>
26-
)
27-
]
17+
decorators: [story => <Wrapper>{story()}</Wrapper>]
2818
};
19+
const Wrapper = styled.div`
20+
padding: 5rem;
21+
background: ${({ theme }) => theme.desktopBackground};
22+
`;
2923

3024
export const Default = () => {
3125
const [open, setOpen] = React.useState(false);

src/Bar/Bar.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import React from 'react';
2+
import styled from 'styled-components';
23

34
import { Bar, AppBar, Toolbar, Button } from 'react95';
45

56
export default {
67
title: 'Bar',
78
component: Bar,
8-
decorators: [
9-
story => (
10-
<div
11-
style={{
12-
padding: '5rem',
13-
background: 'teal'
14-
}}
15-
>
16-
{story()}
17-
</div>
18-
)
19-
]
9+
decorators: [story => <Wrapper>{story()}</Wrapper>]
2010
};
11+
const Wrapper = styled.div`
12+
padding: 5rem;
13+
background: ${({ theme }) => theme.desktopBackground};
14+
`;
2115

2216
export const Default = () => (
2317
<AppBar>

src/Counter/Counter.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Counter, Panel, Button } from 'react95';
55

66
const Wrapper = styled.div`
77
padding: 5rem;
8-
background: teal;
8+
background: ${({ theme }) => theme.desktopBackground};
99
.counter-wrapper {
1010
display: flex;
1111
margin-top: 1rem;

src/DatePicker/DatePicker.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
// ⭕️ DON'T SHOW DATEPICKER BEFORE IT'S FINISHED AND TESTED ⭕️
22

33
// import React from 'react';
4+
// import styled from 'styled-components';
45
// import { DatePicker } from 'react95';
56

67
// export default {
78
// title: 'DatePicker',
89
// component: DatePicker,
9-
// decorators: [
10-
// story => (
11-
// <div
12-
// style={{
13-
// padding: '5rem',
14-
// background: 'teal'
15-
// }}
16-
// >
17-
// {story()}
18-
// </div>
19-
// )
20-
// ]
10+
// decorators: [story => <Wrapper>{story()}</Wrapper>]
2111
// };
12+
// const Wrapper = styled.div`
13+
// padding: 5rem;
14+
// background: ${({ theme }) => theme.desktopBackground};
15+
// `;
2216

2317
// export const Default = () => (
2418
// <DatePicker onAccept={date => console.log(date)} />

src/Desktop/Desktop.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import React from 'react';
2+
import styled from 'styled-components';
23

34
import { Desktop } from 'react95';
45

56
export default {
67
title: 'Desktop',
78
component: Desktop,
8-
decorators: [
9-
story => (
10-
<div
11-
style={{
12-
padding: '5rem',
13-
background: 'teal'
14-
}}
15-
>
16-
{story()}
17-
</div>
18-
)
19-
]
9+
decorators: [story => <Wrapper>{story()}</Wrapper>]
2010
};
11+
const Wrapper = styled.div`
12+
padding: 5rem;
13+
background: ${({ theme }) => theme.desktopBackground};
14+
`;
2115

2216
export const Default = () => (
2317
<Desktop backgroundStyles={{ background: 'blue' }} />

src/Divider/Divider.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import React from 'react';
2+
import styled from 'styled-components';
23

34
import { Divider, List, ListItem } from 'react95';
45

56
export default {
67
title: 'Divider',
78
component: Divider,
8-
decorators: [
9-
story => (
10-
<div
11-
style={{
12-
padding: '5rem',
13-
background: 'teal'
14-
}}
15-
>
16-
{story()}
17-
</div>
18-
)
19-
]
9+
decorators: [story => <Wrapper>{story()}</Wrapper>]
2010
};
11+
const Wrapper = styled.div`
12+
padding: 5rem;
13+
background: ${({ theme }) => theme.desktopBackground};
14+
`;
2115

2216
export const Default = () => (
2317
<>

src/Fieldset/Fieldset.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import React, { useState } from 'react';
2+
import styled from 'styled-components';
23

34
import { Checkbox, Cutout, Fieldset, Window, WindowContent } from 'react95';
45

56
export default {
67
title: 'Fieldset',
78
component: Fieldset,
8-
decorators: [
9-
story => (
10-
<div
11-
style={{
12-
padding: '5rem',
13-
background: 'teal'
14-
}}
15-
>
16-
{story()}
17-
</div>
18-
)
19-
]
9+
decorators: [story => <Wrapper>{story()}</Wrapper>]
2010
};
11+
const Wrapper = styled.div`
12+
padding: 5rem;
13+
background: ${({ theme }) => theme.desktopBackground};
14+
`;
2115

2216
export const Default = () => (
2317
<Window>

src/Hourglass/Hourglass.stories.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import React from 'react';
2+
import styled from 'styled-components';
23

34
import { Hourglass } from 'react95';
45

56
export default {
67
title: 'Hourglass',
78
component: Hourglass,
8-
decorators: [
9-
story => (
10-
<div
11-
style={{
12-
padding: '5rem',
13-
background: '#008080'
14-
}}
15-
>
16-
{story()}
17-
</div>
18-
)
19-
]
9+
decorators: [story => <Wrapper>{story()}</Wrapper>]
2010
};
11+
const Wrapper = styled.div`
12+
padding: 5rem;
13+
background: ${({ theme }) => theme.desktopBackground};
14+
`;
2115

2216
export const Default = () => <Hourglass size={32} />;
2317

src/List/List.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { List, ListItem, Bar, Divider } from 'react95';
55

66
const Wrapper = styled.div`
77
padding: 5rem;
8-
background: teal;
8+
background: ${({ theme }) => theme.desktopBackground};
99
display: flex;
1010
align-items: center;
1111
& > * {

src/Radio/Radio.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313

1414
const Wrapper = styled.div`
1515
padding: 5rem;
16-
background: teal;
16+
background: ${({ theme }) => theme.desktopBackground};
1717
#cutout {
1818
background: ${({ theme }) => theme.canvas};
1919
color: ${({ theme }) => theme.materialText};

0 commit comments

Comments
 (0)