Skip to content

Commit 31a37a1

Browse files
authored
refactor: control sidebar width via tailwind config (#1774)
refactor: extract sidebar width Signed-off-by: Adam Setch <[email protected]>
1 parent ff1b12e commit 31a37a1

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/renderer/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const App = () => {
4747
<BaseStyles>
4848
<AppProvider>
4949
<Router>
50-
<div className="flex flex-col min-h-screen overflow-x-hidden overflow-y-auto pl-10 bg-gitify-background">
50+
<div className="flex flex-col min-h-screen overflow-x-hidden overflow-y-auto pl-sidebar bg-gitify-background">
5151
<Loading />
5252
<Sidebar />
5353
<Routes>

src/renderer/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const Sidebar: FC = () => {
7474
<Stack
7575
direction="vertical"
7676
justify="space-between"
77-
className="fixed left-10 -ml-10 w-10 h-full bg-gitify-sidebar text-white"
77+
className="fixed left-sidebar -ml-sidebar w-sidebar h-full bg-gitify-sidebar text-white"
7878
>
7979
<Stack
8080
direction="vertical"

src/renderer/components/__snapshots__/Sidebar.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tailwind.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { Config } from 'tailwindcss';
22
import colors from 'tailwindcss/colors';
33

4+
const sidebarWidth = '2.5rem'; // 40px
5+
46
const config: Config = {
57
content: ['./src/**/*.js', './src/**/*.ts', './src/**/*.tsx'],
68
darkMode: 'class',
@@ -9,6 +11,12 @@ const config: Config = {
911
fontSize: {
1012
xxs: '0.625rem', // 10px
1113
},
14+
spacing: {
15+
sidebar: sidebarWidth,
16+
},
17+
width: {
18+
sidebar: sidebarWidth,
19+
},
1220
colors: {
1321
gitify: {
1422
font: 'var(--fgColor-default)',

0 commit comments

Comments
 (0)