Skip to content

Commit 7a1ea5e

Browse files
authored
style(app): app mode toggle button styling (usebruno#8523)
1 parent 2079c7a commit 7a1ea5e

1 file changed

Lines changed: 27 additions & 11 deletions

File tree

packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import styled from 'styled-components';
2+
import { rgba } from 'polished';
23

34
const StyledWrapper = styled.div`
45
.collection-switcher {
@@ -219,35 +220,50 @@ const StyledWrapper = styled.div`
219220
.mode-toggle {
220221
display: inline-flex;
221222
align-items: stretch;
222-
padding: 2px;
223-
gap: 2px;
224-
background: ${(props) => props.theme.sidebar.collection.item.hoverBg};
225-
border-radius: ${(props) => props.theme.border.radius.base};
223+
background: transparent;
224+
225+
> * + * .mode-btn,
226+
.mode-btn + .mode-btn {
227+
margin-left: -1px;
228+
}
226229
227230
.mode-btn {
231+
position: relative;
228232
display: flex;
229233
align-items: center;
230234
justify-content: center;
231-
width: 26px;
235+
width: 28px;
236+
height: 26px;
232237
padding: 0;
233-
border: 1px solid transparent;
238+
border: 1px solid ${(props) => props.theme.input.border};
234239
background: transparent;
235240
color: ${(props) => props.theme.colors.text.muted};
236-
border-radius: ${(props) => props.theme.border.radius.sm};
241+
border-radius: 0;
237242
cursor: pointer;
238243
transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
239244
240245
&:hover:not(.active) {
241246
color: ${(props) => props.theme.text};
247+
z-index: 1;
242248
}
243249
244250
&.active {
245-
background: ${(props) => props.theme.bg};
246-
color: ${(props) => props.theme.text};
247-
border-color: ${(props) => props.theme.input.border};
248-
box-shadow: ${(props) => props.theme.shadow.sm};
251+
background: ${(props) => rgba(props.theme.primary.solid, 0.12)};
252+
color: ${(props) => props.theme.primary.solid};
253+
border-color: ${(props) => rgba(props.theme.primary.solid, 0.4)};
254+
z-index: 2;
249255
}
250256
}
257+
258+
> *:first-child .mode-btn {
259+
border-top-left-radius: ${(props) => props.theme.border.radius.sm};
260+
border-bottom-left-radius: ${(props) => props.theme.border.radius.sm};
261+
}
262+
263+
> *:last-child .mode-btn {
264+
border-top-right-radius: ${(props) => props.theme.border.radius.sm};
265+
border-bottom-right-radius: ${(props) => props.theme.border.radius.sm};
266+
}
251267
}
252268
`;
253269

0 commit comments

Comments
 (0)