This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/COR-1899-archived-pages-accordion (#4974)
* feat(COR-1899): First round of visual styling * feat(COR-1899): Fixed overlay issue * refactor(COR-1899): Refactor into modern styled-components css syntax * feat(COR-1899): Size dropdown relevantly for mobile * feat(COR-1899): Fix outlining of arrow icons on mobile * feat(COR-1899): Add condition and reformat * refactor(COR-1899): Refactor useCollapsible destructuring * feat(COR-1899): Apply feedback from codereview. * feat(COR-1899): Leave text black on hover over
- Loading branch information
1 parent
46d6ead
commit 54edfaf
Showing
2 changed files
with
106 additions
and
22 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
packages/app/src/components/aside/components/CategoryDropdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { Box } from '~/components/base'; | ||
import { colors } from '@corona-dashboard/common'; | ||
import { mediaQueries, radii, space } from '~/style/theme'; | ||
import styled from 'styled-components'; | ||
|
||
export const CategoryDropdownRoot = styled(Box)` | ||
@media ${mediaQueries.xl} { | ||
margin: 0; | ||
} | ||
position: relative; | ||
box-shadow: ${space[1]} 0 0 ${space[4]} ${colors.white}; | ||
margin: 0 ${space[2]}; | ||
`; | ||
|
||
export const CategoryDropdown = styled(Box)` | ||
@media ${mediaQueries.xl} { | ||
padding: ${space[2]} ${space[3]} ${space[2]} ${space[2]}; | ||
margin: 0; | ||
} | ||
&:hover { | ||
cursor: pointer; | ||
border-color: ${colors.blue8}; | ||
}, | ||
&:focus { | ||
background: ${colors.white}; | ||
color: ${colors.black}; | ||
} | ||
&:hover, &:focus { | ||
background: ${colors.gray1}; | ||
}, | ||
cursor: default; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
min-height: ${space[2]}; | ||
padding: ${space[2]} ${space[1]} ${space[2]} ${space[1]}; | ||
border-color: ${colors.gray3}; | ||
border-style: solid; | ||
border-width: 1px; | ||
border-radius: ${radii[1]}px; | ||
user-select: none; | ||
transition: 0.1s background-color; | ||
&[aria-expanded=true] { | ||
background: ${colors.white}; | ||
color: ${colors.black}; | ||
border-radius: ${radii[1]}px ${radii[1]}px 0 0; | ||
border-color: ${colors.blue8}; | ||
border-bottom-color: ${colors.white}; | ||
&:hover, &:focus { | ||
border-bottom-color: ${colors.white}; | ||
}, | ||
} | ||
`; | ||
|
||
export const CategorySelectBox = styled(Box)` | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
export const CategoryListBox = styled(Box)` | ||
background: white; | ||
width: 100%; | ||
overflow-y: clip; | ||
border-color: ${colors.blue8}; | ||
border-style: solid; | ||
border-width: 1px; | ||
border-top-width: 0; | ||
display: none; | ||
${CategoryDropdown}[aria-expanded=true] + & { | ||
display: block; | ||
border-radius: 0 0 ${radii[1]}px ${radii[1]}px; | ||
} | ||
`; | ||
|
||
export const CategoryListBoxOption = styled(Box)` | ||
cursor: default; | ||
a { | ||
@media ${mediaQueries.xl} { | ||
padding: ${space[2]} ${space[2]} ${space[2]} 3rem; | ||
} | ||
padding: ${space[2]} 0 ${space[2]} ${space[4]}; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters