Skip to content

Commit

Permalink
add horizontal scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
001elijah committed Jun 30, 2023
1 parent f5c79b5 commit 9efd330
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/MainBoard/MainBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const MainBoard = () => {
colorbg={curTheme}
>
<HeaderDashBoard title={board.title} />
<ContentBoard>
<ContentBoard currentTheme={curTheme}>
<ColumnsList>
{board.columns.map(item => (
<TasksColumnHeader
Expand Down
69 changes: 67 additions & 2 deletions src/components/MainBoard/MainBoard.styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,73 @@ export const Wrappers = styled.div`
export const ColumnsList = styled.ul`
display: flex;
`;
export const ContentBoard = styled.div`
export const ContentBoard = styled.div(props => {
const lightTheme = `
display: flex;
wrap: nowrap;
overflow: auto;
`;
&::-webkit-scrollbar {
height: 12px;
margin-top: 16px;
margin-left: 8px;
margin-right: 2px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(22, 22, 22, 0.1);
border-radius: 100vw;
}
&::-webkit-scrollbar-track {
background-color: #e6e6e6;
border-radius: 100vw;
}`;
const darkTheme = `
display: flex;
wrap: nowrap;
overflow: auto;
&::-webkit-scrollbar {
height: 12px;
margin-top: 16px;
margin-left: 8px;
margin-right: 2px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(18, 18, 18, 1);
border-radius: 100vw;
}
&::-webkit-scrollbar-track {
background-color: #e6e6e6;
border-radius: 100vw;
}`;
const colorfulTheme = `
display: flex;
wrap: nowrap;
overflow: auto;
&::-webkit-scrollbar {
height: 12px;
margin-top: 16px;
margin-left: 8px;
margin-right: 2px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(184, 188, 253, 1);
border-radius: 100vw;
}
&::-webkit-scrollbar-track {
background-color: #e6e6e6;
border-radius: 100vw;
}`;

if (props.currentTheme === "#F6F6F7") {
return lightTheme;
} else if (props.currentTheme === "#1F1F1F") {
return darkTheme;
} else {
return colorfulTheme;
}
});

0 comments on commit 9efd330

Please sign in to comment.