Skip to content
Snippets Groups Projects
Commit 37ea64b1 authored by Felipe D'Abrantes's avatar Felipe D'Abrantes
Browse files

Add shadows to the scrollable list

parent 58290dce
Branches main
No related tags found
1 merge request!25Add a question management page
import { FC } from 'react'; import { FC } from 'react';
import { QuestionRecord } from '@/hooks/useQuestions'; import { QuestionRecord } from '@/hooks/useQuestions';
import { TrashIcon } from '@heroicons/react/24/outline'; import { TrashIcon } from '@heroicons/react/24/outline';
import styles from '../../styles/Scrollbox.module.css';
type QuestionListProps = { type QuestionListProps = {
questions: QuestionRecord[]; questions: QuestionRecord[];
...@@ -9,7 +10,10 @@ type QuestionListProps = { ...@@ -9,7 +10,10 @@ type QuestionListProps = {
const QuestionList: FC<QuestionListProps> = ({ questions }) => ( const QuestionList: FC<QuestionListProps> = ({ questions }) => (
<ul <ul
role="list" role="list"
className="flex flex-col min-h-min max-w-lg overflow-y-scroll divide-y divide-gray-100 " className={
'flex flex-col min-h-min max-w-lg overflow-y-scroll divide-y divide-gray-100 mt-4 ' +
styles['scrollbox-shadows']
}
> >
{questions.map((question: QuestionRecord) => ( {questions.map((question: QuestionRecord) => (
<li <li
......
.scrollbox-shadows {
background: /* Shadow covers */
linear-gradient(white 30%, rgba(255, 255, 255, 0)), linear-gradient(rgba(255, 255, 255, 0), white 70%) 0 100%, /* Shadows */
radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;
background-repeat: no-repeat;
background-color: white;
background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
background-attachment: local, local, scroll, scroll;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment