Improve styles to avoid FOUC

This commit is contained in:
Hazem Krimi
2022-01-29 22:28:53 +01:00
parent 14e1970a56
commit f00dc80aae
8 changed files with 36 additions and 28 deletions
+4 -2
View File
@@ -7,13 +7,14 @@ export const Btn = styled.button<Omit<Props, 'href'>>`
cursor: pointer;
background: none;
color: var(--text);
border: ${({ variant }) => (variant === 'outline' ? '2px solid var(--text)' : 'none')};
border: ${({ variant }) =>
variant === 'outline' ? '2px solid var(--text)' : '2px solid transparent'};
font-weight: bold;
text-transform: ${({ variant }) => (variant === 'outline' ? 'uppercase' : 'inherit')};
padding: ${({ variant }) => (variant === 'outline' ? '.5rem 1rem' : '0rem')};
text-align: left;
text-decoration: none;
transition: color 250ms ease-in-out;
transition: color 250ms ease-in-out, border 250ms ease-in-out;
z-index: 1;
@media (max-width: 768px) {
@@ -36,6 +37,7 @@ export const Btn = styled.button<Omit<Props, 'href'>>`
&:hover {
color: ${({ variant }) => (variant === 'outline' ? 'var(--background)' : 'inherit')};
border: 2px solid transparent;
}
&:hover::before {
+4 -1
View File
@@ -13,7 +13,10 @@ export const StyledCard = styled.div<{ image: boolean }>`
&:hover {
& > div {
background: ${({ theme }) => theme.colors.blue};
color: ${({ theme }) => theme.colors.dark.text};
* {
color: ${({ theme }) => theme.colors.dark.text} !important;
}
}
img {
+4 -1
View File
@@ -36,7 +36,10 @@ const GlobalStyles = createGlobalStyle`
position: relative;
min-height: 100%;
background: var(--background) !important;
color: var(--text) !important;
}
* {
color: var(--text);
}
ul, ol {
+16 -4
View File
@@ -37,18 +37,30 @@ const MobileNav: FC<Props> = ({ open, close }) => {
/>
</div>
<div className='mobile-button-wrapper'>
<Button href='#' onClick={() => toggle()}>
<Button
href='#'
onClick={() => {
toggle();
close();
}}
>
{mode === 'dark' ? 'Light Mode' : 'Dark Mode'}
</Button>
</div>
<div className='mobile-button-wrapper'>
<Button href='/about'>About</Button>
<Button href='/about' onClick={() => close()}>
About
</Button>
</div>
<div className='mobile-button-wrapper'>
<Button href='/portfolio'>Portfolio</Button>
<Button href='/portfolio' onClick={() => close()}>
Portfolio
</Button>
</div>
<div className='mobile-button-wrapper'>
<Button href='/blog'>Blog</Button>
<Button href='/blog' onClick={() => close()}>
Blog
</Button>
</div>
</Bar>
);