Skip to content

Commit

Permalink
add themed vertical scroll to columns
Browse files Browse the repository at this point in the history
  • Loading branch information
001elijah committed Jun 28, 2023
1 parent d7f4bd3 commit a9d8143
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/components/ButtonAddColumn/ButtonAddColumn.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
}
}
&.Card {
width: 335px;
&.dark {
background-color: $accent-color;
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/TaskCard/TaskCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
.cardWrapper {
position: relative;
padding: 14px 21px;
max-width: 335px;
width: 335px;
margin-right: 8px;
height: 154px;
background-color: $white-text-color;
border-radius: 8px;
Expand Down
12 changes: 11 additions & 1 deletion src/components/TaskColumn/TaskColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import { selectCards } from 'redux/Cards/cardsSelectors';
import { addCard } from 'redux/Cards/cardsOperations';
import shortid from 'shortid';
import { currentBoard } from 'redux/Boards/boardsSelectors';
import s from './TaskColumn.module.scss';
import { selectorTheme } from 'redux/Auth/authSelectors';
import clsx from 'clsx';

export const TaskColumn = ({ columnId }) => {
const dispatch = useDispatch();
const { _id } = useSelector(currentBoard);
const theme = useSelector(selectorTheme);
const [modalOpen, setModalOpen] = useState(false);
const ModalWindowOpen = () => setModalOpen(true);
const modalWindowClose = () => setModalOpen(false);
Expand All @@ -33,7 +37,13 @@ export const TaskColumn = ({ columnId }) => {

return (
<>
<ul>
<ul
className={clsx(
theme === 'light' && s.taskCardListLight,
theme === 'dark' && s.taskCardListDark,
theme === 'colorful' && s.taskCardListColorful,
)}
>
{cards
.filter(card => {
return card.columnId === columnId;
Expand Down
87 changes: 81 additions & 6 deletions src/components/TaskColumn/TaskColumn.module.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,94 @@
@import '../../assets/styles/vars';
@import '../../assets/styles/mixins';

.taskCardList {
.taskCardListLight {
margin-bottom: 10px;
overflow-y: auto;
overflow-y: scroll;
overflow-x: hidden;
max-height: calc(100vh - 280px);

&::-webkit-scrollbar {
width: 8px;
height: 12px;
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: $background-color;
border-radius: 100vw;
}

@include tablet {
max-height: calc(100vh - 290px);
}

@include desktop {
max-height: calc(100vh - 278px);
}
}
.taskCardListDark {
margin-bottom: 10px;
overflow-y: auto;
max-height: calc(100vh - 280px);

&::-webkit-scrollbar {
width: 8px;
height: 12px;
margin-left: 8px;
margin-right: 2px;
}

&::-webkit-scrollbar-thumb {
background-color: rgba(18, 18, 18, 1);
border-radius: 100vw;
}

&::-webkit-scrollbar-track {
background-color: $background-color;
border-radius: 100vw;
}

@include tablet {
.taskCardList {
@include tablet {
max-height: calc(100vh - 290px);
}

@include desktop {
max-height: calc(100vh - 278px);
}
}
@include desktop {
.taskCardList {
.taskCardListColorful {
margin-bottom: 10px;
overflow-y: auto;
max-height: calc(100vh - 280px);

&::-webkit-scrollbar {
width: 8px;
height: 12px;
margin-left: 8px;
margin-right: 2px;
}

&::-webkit-scrollbar-thumb {
background-color: rgba(184, 188, 253, 1);
border-radius: 100vw;
}

&::-webkit-scrollbar-track {
background-color: $background-color;
border-radius: 100vw;
}

@include tablet {
max-height: calc(100vh - 290px);
}

@include desktop {
max-height: calc(100vh - 278px);
}
}
28 changes: 14 additions & 14 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ code {
@include container;
}

::-webkit-scrollbar {
width: 8px;
height: 12px;
margin-left: 8px;
margin-right: 2px;
}
// ::-webkit-scrollbar {
// width: 8px;
// height: 12px;
// margin-left: 8px;
// margin-right: 2px;
// }

::-webkit-scrollbar-thumb {
background-color: $dark-color;
border-radius: 100vw;
}
// ::-webkit-scrollbar-thumb {
// background-color: $dark-color;
// border-radius: 100vw;
// }

::-webkit-scrollbar-track {
background-color: $background-color;
border-radius: 100vw;
}
// ::-webkit-scrollbar-track {
// background-color: $background-color;
// border-radius: 100vw;
// }

0 comments on commit a9d8143

Please sign in to comment.