Skip to content

Commit d9e824e

Browse files
committed
improve UI of onboarding
1 parent 85690eb commit d9e824e

File tree

3 files changed

+29
-23
lines changed

3 files changed

+29
-23
lines changed

code/addons/onboarding/src/features/WriteStoriesModal/WriteStoriesModal.styled.tsx

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { keyframes, styled } from '@storybook/theming';
22
import { Modal } from '@storybook/components';
33

4-
export const ModalWrapper = styled(Modal)`
5-
background: white;
6-
`;
4+
export const ModalWrapper = styled(Modal)``;
75

86
export const ModalContent = styled.div`
97
display: flex;
@@ -21,10 +19,13 @@ export const Main = styled.div`
2119
flex: 1;
2220
display: flex;
2321
flex-direction: column;
22+
background: white;
2423
font-family: ${({ theme }) => theme.typography.fonts.base};
2524
`;
2625

2726
export const Header = styled.div`
27+
position: relative;
28+
z-index: 1;
2829
box-sizing: border-box;
2930
display: flex;
3031
justify-content: space-between;
@@ -64,20 +65,20 @@ export const Content = styled.div`
6465
}
6566
`;
6667

67-
export const SpanHighlight = styled.span`
68-
display: inline-flex;
69-
border-radius: 3px;
70-
padding: 0 5px;
71-
margin-bottom: -2px;
72-
opacity: 0.8;
73-
font-family: ${({ theme }) => theme.typography.fonts.mono};
74-
font-size: 11px;
75-
border: 1px solid #ecf4f9;
76-
color: ${({ theme }) => theme.color.darkest};
77-
background-color: #f7fafc;
78-
box-sizing: border-box;
79-
line-height: 17px;
80-
`;
68+
export const SpanHighlight = styled.span(({ theme }) => ({
69+
display: 'inline-flex',
70+
borderRadius: 3,
71+
padding: '0 5px',
72+
marginBottom: -2,
73+
opacity: 0.8,
74+
fontFamily: theme.typography.fonts.mono,
75+
fontSize: 11,
76+
border: theme.base === 'dark' ? theme.color.darkest : theme.color.lightest,
77+
color: theme.base === 'dark' ? theme.color.lightest : theme.color.darkest,
78+
backgroundColor: theme.base === 'dark' ? 'black' : theme.color.light,
79+
boxSizing: 'border-box',
80+
lineHeight: '17px',
81+
}));
8182

8283
export const Image = styled.img`
8384
max-width: 100%;
@@ -90,8 +91,10 @@ export const Background = styled.div`
9091
left: 0;
9192
width: 100%;
9293
height: 100%;
93-
z-index: -1;
94+
z-index: 0;
9495
overflow: hidden;
96+
z-index: 0;
97+
pointer-events: none;
9598
`;
9699

97100
export const circle1Anim = keyframes`

code/addons/onboarding/src/features/WriteStoriesModal/WriteStoriesModal.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ export const WriteStoriesModal: FC<WriteStoriesModalProps> = ({
124124
</Button>
125125
)}
126126
<Main>
127+
<Background>
128+
<Circle1 />
129+
<Circle2 />
130+
<Circle3 />
131+
</Background>
132+
127133
<Header>
128134
<Modal.Title asChild>
129135
<ModalTitle>
@@ -280,11 +286,6 @@ export const WriteStoriesModal: FC<WriteStoriesModalProps> = ({
280286
) : null)}
281287
</Content>
282288
</Modal.Description>
283-
<Background>
284-
<Circle1 />
285-
<Circle2 />
286-
<Circle3 />
287-
</Background>
288289
</Main>
289290
</ModalContent>
290291
</ModalWrapper>

code/ui/components/src/components/Modal/Modal.styled.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export const Title = styled(Dialog.Title)(({ theme }) => ({
101101
}));
102102

103103
export const Description = styled(Dialog.Description)(({ theme }) => ({
104+
position: 'relative',
105+
zIndex: 1,
104106
margin: 0,
105107
fontSize: theme.typography.size.s2,
106108
}));

0 commit comments

Comments
 (0)