Fixed console errors, added Delay to themeselector transition

Transition now only rounds the corners after the dropdown is retracted
This commit is contained in:
Neshura 2022-12-17 21:35:40 +01:00
parent f178058578
commit 5ee7c8ef2e
No known key found for this signature in database
GPG key ID: ACDF5B6EBECF6B0A
2 changed files with 5 additions and 3 deletions

View file

@ -2,7 +2,7 @@ import styled from 'styled-components'
import Link from 'next/link'; import Link from 'next/link';
interface ActivePropType { interface ActivePropType {
active?: false | true; active?: number;
} }
export const NavWrap = styled.div` export const NavWrap = styled.div`

View file

@ -1,11 +1,11 @@
import styled from 'styled-components'; import styled from 'styled-components';
interface DisplayPropType { interface DisplayPropType {
show?: false | true; show?: number;
} }
interface ActivePropType { interface ActivePropType {
active?: false | true; active?: number;
} }
export const ThemeDropDown = styled.div` export const ThemeDropDown = styled.div`
@ -28,6 +28,7 @@ export const ThemeDropDownButton = styled.button<DisplayPropType>`
transition-property: color, border-bottom-left-radius, border-bottom-right-radius; transition-property: color, border-bottom-left-radius, border-bottom-right-radius;
transition-timing-function: ease; transition-timing-function: ease;
transition-duration: 0.15s; transition-duration: 0.15s;
transition-delay: 0, ${ props => props.show ? "0s" : "0.6s" };
&:focus,:hover { &:focus,:hover {
color: ${({ theme }) => theme.colors.secondary}; color: ${({ theme }) => theme.colors.secondary};
@ -62,6 +63,7 @@ export const ThemeDropDownOptions = styled.div<DisplayPropType>`
export const ThemeDropDownOption = styled.button<ActivePropType>` export const ThemeDropDownOption = styled.button<ActivePropType>`
color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary }; color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary };
background-color: ${({ theme }) => theme.colors.background}; background-color: ${({ theme }) => theme.colors.background};
cursor: pointer;
align-self: center; align-self: center;
border: 0px solid; border: 0px solid;
padding: 0.2rem 0.5rem; padding: 0.2rem 0.5rem;