Skip to content

Commit 1b35c57

Browse files
authored
Sidebar - Lots of polish? (codesandbox#3473)
* add styles for resizer outside sidebar * remove shadow from button * select: increase space next to icon * use list hover color instead of sidebar * list hover colors * switch colors * change sidebar border for codesandbox * use list hoverbackground instead of sidebar for deps * add space between avatars in live * button line height fix * make config button height 5 * better naming for switch * remove extra px from closed border * make switch visible on backgrounds * better hover for avatar in summary * change white to full hex for theme === * update snapshot for test
1 parent dac6ada commit 1b35c57

File tree

15 files changed

+83
-47
lines changed

15 files changed

+83
-47
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/ConfigurationFiles/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const ConfigurationFilesComponent = ({ theme }) => {
112112
<Button
113113
css={css({
114114
width: 'auto',
115-
height: 4,
115+
height: 5,
116116
})}
117117
variant="secondary"
118118
onClick={() => editor.moduleSelected({ id: module.id })}

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Explorer/Dependencies/Dependency/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class Dependency extends React.PureComponent<Props, State> {
130130
css={css({
131131
position: 'relative',
132132
'.actions': { backgroundColor: 'sideBar.background' },
133-
':hover .actions': { backgroundColor: 'sideBar.hoverBackground' },
133+
':hover .actions': { backgroundColor: 'list.hoverBackground' },
134134
})}
135135
>
136136
<Link

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Live/LiveNow.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const LiveNow = () => {
150150
</Collapsible>
151151

152152
<Collapsible title="Editors" defaultOpen>
153-
<Element css={css({ paddingX: 2 })}>
153+
<Stack direction="vertical" gap={2} css={css({ paddingX: 2 })}>
154154
{owners.map(user => (
155155
<User key={user.id} user={user} liveRole="owner" />
156156
))}
@@ -161,20 +161,20 @@ export const LiveNow = () => {
161161
spectators.map(user => (
162162
<User key={user.id} user={user} liveRole="editor" />
163163
))}
164-
</Element>
164+
</Stack>
165165
</Collapsible>
166166

167167
{mode === 'classroom' && (
168168
<Collapsible title="Viewers" defaultOpen>
169-
<Element css={css({ paddingX: 2 })}>
169+
<Stack direction="vertical" gap={2} css={css({ paddingX: 2 })}>
170170
{spectators.map(user => (
171171
<User key={user.id} user={user} liveRole="spectator" />
172172
))}
173173

174174
{spectators.length
175175
? null
176176
: 'No other users in session, invite them! '}
177-
</Element>
177+
</Stack>
178178
</Collapsible>
179179
)}
180180
</>

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/ProjectInfo/Summary.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,13 @@ export const Summary = () => {
9999

100100
<Element as="section" css={css({ paddingX: 2 })}>
101101
{author ? (
102-
<Link href={profileUrl(author.username)}>
103-
<Stack gap={2} align="center" marginBottom={4}>
102+
<Link variant="muted" href={profileUrl(author.username)}>
103+
<Stack
104+
gap={2}
105+
align="center"
106+
css={{ display: 'inline-flex' }}
107+
marginBottom={4}
108+
>
104109
<Avatar user={author} /> <Text>{author.username}</Text>
105110
</Stack>
106111
</Link>

packages/common/src/design-language/colors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const colors = {
2-
white: '#fff',
2+
white: '#ffffff',
33
grays: {
44
100: '#fff9f9',
55
200: '#e6e6e6',

packages/common/src/theme/__snapshots__/theme.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ Object {
501501
"scrollbarSlider.activeBackground": "#374140",
502502
"scrollbarSlider.background": "#37414050",
503503
"sideBar.background": "#191d1f",
504-
"sideBar.border": "#111518",
504+
"sideBar.border": "#2d2d2d",
505505
"statusBar.background": "#1C2022",
506506
"statusBar.border": "#111518",
507507
"tab.activeBackground": "#1C2022",

packages/common/src/themes/codesandbox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"scrollbarSlider.activeBackground": "#374140",
2525
"scrollbarSlider.background": "#37414050",
2626
"sideBar.background": "#191d1f",
27-
"sideBar.border": "#111518",
27+
"sideBar.border": "#2d2d2d",
2828
"statusBar.background": "#1C2022",
2929
"statusBar.border": "#111518",
3030
"tab.activeBackground": "#1C2022",

packages/components/src/components/Button/index.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ import css from '@styled-system/css';
33
import deepmerge from 'deepmerge';
44
import { Element } from '../Element';
55

6-
// totally custom button shadow, same across themes
7-
const interactionShadows = {
8-
hover: '0px 2px 4px rgba(0, 0, 0, 0.1)',
9-
focus: '0px 2px 4px rgba(0, 0, 0, 0.4)',
10-
};
11-
126
const variantStyles = {
137
primary: {
148
backgroundColor: 'button.background',
@@ -21,13 +15,11 @@ const variantStyles = {
2115
// so we need to write the long syntax
2216
// TODO @sid: extend our system to make background work as well
2317
background: theme => theme.colors.button.hoverBackground,
24-
boxShadow: interactionShadows.hover,
2518
},
2619
':focus': {
2720
// we use the same colors for hover and focus
2821
// but we add an active state to give
2922
background: theme => theme.colors.button.hoverBackground,
30-
boxShadow: interactionShadows.focus,
3123
},
3224
':disabled:hover': {
3325
background: 'transparent', // override hover
@@ -40,11 +32,9 @@ const variantStyles = {
4032
// same technique as primary
4133
':hover': {
4234
background: theme => theme.colors.secondaryButton.hoverBackground,
43-
boxShadow: interactionShadows.hover,
4435
},
4536
':focus': {
4637
background: theme => theme.colors.secondaryButton.hoverBackground,
47-
boxShadow: interactionShadows.focus,
4838
},
4939
':disabled:hover': {
5040
background: 'transparent', // override hover
@@ -68,11 +58,9 @@ const variantStyles = {
6858
// same technique as primary
6959
':hover': {
7060
background: theme => theme.colors.dangerButton.hoverBackground,
71-
boxShadow: interactionShadows.hover,
7261
},
7362
':focus': {
7463
background: theme => theme.colors.dangerButton.hoverBackground,
75-
boxShadow: interactionShadows.focus,
7664
},
7765

7866
':disabled:hover': {
@@ -106,6 +94,7 @@ export const Button = styled(Element).attrs({ as: 'button' })<{
10694
height: 6,
10795
width: '100%',
10896
fontSize: 2,
97+
lineHeight: 1, // trust the height
10998
border: 'none',
11099
borderRadius: 'small',
111100
transition: 'all ease-in',

packages/components/src/components/Collapsible/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const Body = styled(Element)<{
4141
open?: boolean;
4242
}>(props =>
4343
css({
44-
borderBottom: '1px solid',
44+
borderBottom: props.open ? '1px solid' : 'none',
4545
borderColor: 'sideBar.border',
4646
maxHeight: props.open ? '1000px' : 0,
4747
overflow: props.open ? 'auto' : 'hidden',

packages/components/src/components/Link/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const LinkElement = styled(Text).attrs({ as: 'a' })<ILinkProps>(
1717
transition: 'color ease',
1818
transitionDuration: theme => theme.speeds[2],
1919
':hover, :focus': {
20-
color: 'inherit',
20+
color: 'foreground',
2121
},
2222
})
2323
);

0 commit comments

Comments
 (0)