Skip to content

Commit

Permalink
refactor: use named values for colors
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeanerd committed Sep 11, 2023
1 parent f009949 commit 7d37bd8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
@tailwind utilities;

body {
@apply dark:bg-gray-900 dark:text-gray-200 bg-gray-200 text-gray-900;
@apply bg-background-light text-content-light dark:bg-background-dark dark:text-content-dark;
}
5 changes: 4 additions & 1 deletion components/inlineLink.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<CustomRouterLink :to="props.to" class="text-green-300 hover:text-green-400">
<CustomRouterLink
:to="props.to"
class="text-primary-base-light hover:text-primary-highlight-light dark:text-primary-base-dark dark:hover:text-primary-highlight-dark"
>
<slot />
</CustomRouterLink>
</template>
Expand Down
12 changes: 6 additions & 6 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ const themeConfig: ThemeConfig = {
},
light: {
common: {
primaryColor: theme.colors.blue[600],
primaryColorHover: theme.colors.blue[500],
primaryColorPressed: theme.colors.blue[700],
primaryColor: theme.colors.green[500],
primaryColorHover: theme.colors.green[400],
primaryColorPressed: theme.colors.green[500],
},
},
dark: {
common: {
primaryColor: theme.colors.blue[500],
primaryColorHover: theme.colors.blue[400],
primaryColorPressed: theme.colors.blue[600],
primaryColor: theme.colors.green[300],
primaryColorHover: theme.colors.green[400],
primaryColorPressed: theme.colors.green[500],
},
},
};
Expand Down
17 changes: 16 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import type { Config } from 'tailwindcss';

import colors from 'tailwindcss/colors';

export default <Partial<Config>>{
theme: {
extend: {},
extend: {
colors: {
primary: {
base: {
light: colors.green[500],
dark: colors.green[300],
},
highlight: { light: colors.green[400], dark: colors.green[400] },
action: { light: colors.green[500], dark: colors.green[500] },
},
background: { light: colors.gray[200], dark: colors.gray[900] },
content: { light: colors.gray[900], dark: colors.gray[200] },
},
},
},
darkMode: 'class',
};

0 comments on commit 7d37bd8

Please sign in to comment.