Skip to content

Commit

Permalink
feat: add street theme
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorusclarence committed Feb 6, 2022
1 parent fbdacd0 commit abfa0a1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export default function Layout({ children }: { children: React.ReactNode }) {
return (
<div className={theme}>
<div
className={clsx('dark:bg-dark dark:text-white', 'milky:bg-[#fff5e3]')}
className={clsx(
'dark:bg-dark dark:text-white',
'milky:bg-[#fff5e3] street:bg-street-800'
)}
>
{demoMode && (
<select
Expand All @@ -21,6 +24,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<option value='light'>light</option>
<option value='dark'>dark</option>
<option value='theme-milky'>milky</option>
<option value='theme-street dark'>street</option>
</select>
)}
{children}
Expand Down
6 changes: 4 additions & 2 deletions src/components/links/TreeLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default function TreeLink({
'accent-gradient bg-gradient-to-r',
'transition duration-300 group-hover:duration-200',
'milky:rounded-full',
'pointer-events-none'
'pointer-events-none',
'street:group-hover:animate-flickerStreet'
)}
/>

Expand All @@ -36,7 +37,8 @@ export default function TreeLink({
'focus:outline-none focus-visible:ring focus-visible:ring-primary-500',
'border-gray-400 bg-white',
'dark:border-gray-600 dark:bg-dark',
'milky:rounded-full milky:bg-milky-100 milky:text-milky-500'
'milky:rounded-full milky:bg-milky-100 milky:text-milky-500',
'street:bg-street-800'
)}
>
{icon ? (
Expand Down
13 changes: 13 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
--tw-clr-milky-100: 255, 245, 227; /* #fff5e3 */
--tw-clr-milky-400: 129, 100, 82; /* #81644a */
--tw-clr-milky-500: 112, 77, 55; /* #70554f */

--tw-clr-street-400: 184, 105, 255; /* #b869ff */
--tw-clr-street-500: 104, 107, 253; /* #686afd */
--tw-clr-street-800: 1, 22, 39; /* #011627 */
}

@layer base {
Expand Down Expand Up @@ -115,4 +119,13 @@
.theme-milky .accent-gradient {
@apply from-milky-400 to-milky-500;
}

.theme-street {
--tw-clr-primary-400: var(--tw-clr-street-400);
--tw-clr-primary-500: var(--tw-clr-street-500);
--tw-clr-primary-800: var(--tw-clr-street-800);
}
.theme-street .accent-gradient {
@apply from-street-400 to-street-500;
}
/* #endregion /**======== Theme =========== */
19 changes: 18 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
darkMode: 'class',
theme: {
themeVariants: ['light', 'milky'],
themeVariants: ['light', 'milky', 'street'],
extend: {
fontFamily: {
primary: ['Inter', ...fontFamily.sans],
Expand All @@ -40,6 +40,11 @@ module.exports = {
400: withOpacity('--tw-clr-milky-400'),
500: withOpacity('--tw-clr-milky-500'),
},
street: {
400: withOpacity('--tw-clr-street-400'),
500: withOpacity('--tw-clr-street-500'),
800: withOpacity('--tw-clr-street-800'),
},
dark: '#222222',
},
keyframes: {
Expand All @@ -54,6 +59,17 @@ module.exports = {
filter: 'none',
},
},
flickerStreet: {
'0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100%': {
opacity: 0.99,
filter:
'drop-shadow(0 0 1px rgba(184, 105, 255)) drop-shadow(0 0 15px rgba(104, 107, 253)) drop-shadow(0 0 1px rgba(184, 105, 255))',
},
'20%, 21.999%, 63%, 63.999%, 65%, 69.999%': {
opacity: 0.4,
filter: 'none',
},
},
tilt: {
'0%, 50%, 100%': {
transform: 'rotate(0deg)',
Expand All @@ -68,6 +84,7 @@ module.exports = {
},
animation: {
flicker: 'flicker 3s linear infinite',
flickerStreet: 'flickerStreet 3s linear infinite',
tilt: 'tilt 10s infinite linear',
},
},
Expand Down

0 comments on commit abfa0a1

Please sign in to comment.