-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: alert dark mode * feat: dark mode autocomplete * fix(alert): improve alert dark mode * fix(avatar): dark mode * fix(badge): add dark mode * fix(breadcrumbs): add dark mode & fix typo class * fix(VAppBar): fix sticky value * fix(card): add dark mode * fix(table): add dark mode * fix: dark mode pagination and table pagination * fix(dropdown): add dark mode * fix(list): add dark mode * fix(button): add dark mode * fix(checkbox): add dark mode * chore: fix path * feat(VInput): add dark mode * feat(VRadio): add dark mode * feat(VFormGroup): add dark mode * feat(VMultiSelect): add dark mode * feat(VRadioGroup): add dark mode * feat(VFormSelect): add dark mode * feat(VMenus): add dark mode * feat(VModal): add dark mode * feat(VIcon): add dark mode * feat(NavDrawer): add dark mode * feat(ProgressBar): add dark mode * feat(VSelect): add dark mode * feat(VShimmer): add dark mode * feat(VSwitch): add dark mode * feat(Vtabs): add dark mode * feat(ui): add dark mode styles * feat(nuxt): add new `darkMode` option * feat(nuxt): load transition css when not using css or sass bundle * chore(nuxt): update nuxt playground * feat: dark mode * feat(AppBar): dark mode * docs: add dark mode docs * docs: update readme * chore: remove unused import * chore(story): update dark mode stories * docs: update * feat(autocomplete): add css variable and improve dark mode * chore: fix dark mode story for v-data-table-pagination * feat: alert dark mode * feat: dark mode autocomplete * fix(alert): improve alert dark mode * fix(avatar): dark mode * fix(badge): add dark mode * fix(breadcrumbs): add dark mode & fix typo class * fix(VAppBar): fix sticky value * fix(card): add dark mode * fix(table): add dark mode * fix: dark mode pagination and table pagination * fix(dropdown): add dark mode * fix(list): add dark mode * fix(button): add dark mode * fix(checkbox): add dark mode * chore: fix path * feat(VInput): add dark mode * feat(VRadio): add dark mode * feat(VFormGroup): add dark mode * feat(VMultiSelect): add dark mode * feat(VRadioGroup): add dark mode * feat(VFormSelect): add dark mode * feat(VMenus): add dark mode * feat(VModal): add dark mode * feat(VIcon): add dark mode * feat(NavDrawer): add dark mode * feat(ProgressBar): add dark mode * feat(VSelect): add dark mode * feat(VShimmer): add dark mode * feat(VSwitch): add dark mode * feat(Vtabs): add dark mode * feat(ui): add dark mode styles * feat(nuxt): add new `darkMode` option * feat(nuxt): load transition css when not using css or sass bundle * chore(nuxt): update nuxt playground * feat: dark mode * feat(AppBar): dark mode * docs: add dark mode docs * docs: update readme * chore: remove unused import * chore(story): update dark mode stories * docs: update * feat(autocomplete): add css variable and improve dark mode * chore: fix dark mode story for v-data-table-pagination * chore: remove extra whitespace
- Loading branch information
Showing
120 changed files
with
2,039 additions
and
227 deletions.
There are no files selected for viewing
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
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
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,74 @@ | ||
# Dark Mode | ||
|
||
The GITS UI includes dark mode support by default, however, to enable it, you will need to load the styles explicitly. | ||
|
||
## Tailwind Configuration | ||
|
||
To enable dark mode, you need to set the `darkMode` option to `class` in your Tailwind config file. | ||
|
||
```ts {2} | ||
module.exports = { | ||
darkMode: 'class', | ||
}; | ||
``` | ||
|
||
## Enabling Dark Mode on a Vue App | ||
|
||
To enable dark mode on a Vue application, load the dark mode styles in your `main.ts` file. | ||
|
||
```ts {10} | ||
import {createApp} from 'vue'; | ||
import {createPinia} from 'pinia'; | ||
import App from './App.vue'; | ||
import router from './router'; | ||
import GitsUi from '@gits-id/ui'; | ||
import './assets/index.css'; | ||
import '@gits-id/ui/styles.scss'; | ||
|
||
// load dark mode styles | ||
import '@gits-id/ui/styles.dark'; | ||
|
||
const app = createApp(App); | ||
|
||
app.use(createPinia()); | ||
app.use(router); | ||
app.use(GitsUi); | ||
|
||
app.mount('#app'); | ||
``` | ||
|
||
## Enabling Dark Mode on a Nuxt App | ||
|
||
To enable dark mode on a Nuxt application, set the value of `darkMode` option to `true` in your `nuxt.config.ts` file. | ||
|
||
```ts {4} | ||
export default defineNuxtConfig({ | ||
modules: ['@gits-id/ui-nuxt', '@nuxtjs/tailwindcss'], | ||
gitsUi: { | ||
darkMode: true, | ||
}, | ||
}); | ||
``` | ||
|
||
## Toggling between dark and light mode | ||
|
||
You can toggle between `dark` and `light` mode by toggling the `class` of the parent element between `dark` or `light`. For example, you can set the value of the `html` class to `dark` to enable dark mode and `light` to enable light mode. | ||
|
||
```vue | ||
<script setup lang="ts"> | ||
const toggleDarkMode = () => { | ||
const html = document.querySelector('html'); | ||
html?.classList?.toggle('dark'); | ||
}; | ||
const darkMode = ref(false); | ||
</script> | ||
<template> | ||
<VSwitch | ||
v-model="darkMode" | ||
label="Dark Mode" | ||
@update:model-value="toggleDarkMode" | ||
/> | ||
</template> | ||
``` |
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
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
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,37 @@ | ||
.dark { | ||
.alert { | ||
// default variant | ||
&-default:not(.alert--outlined):not(.alert--bordered):not(.alert--solid) { | ||
--alert-bg-color: theme('colors.neutral.800'); | ||
--alert-text-color: theme('colors.neutral.200'); | ||
--alert-border-color: theme('colors.neutral.800'); | ||
} | ||
|
||
// solid variant | ||
&--solid { | ||
&.alert-default { | ||
--alert-bg-color: theme('colors.neutral.800'); | ||
--alert-border-color: theme('colors.neutral.800'); | ||
--alert-text-color: theme('colors.neutral.200'); | ||
} | ||
} | ||
|
||
// outlined variant | ||
&--outlined { | ||
&.alert-default { | ||
--alert-text-color: theme('colors.neutral.200'); | ||
} | ||
&.alert-dark { | ||
--alert-text-color: theme('colors.neutral.200'); | ||
--alert-border-color: theme('colors.neutral.700'); | ||
} | ||
} | ||
|
||
// bordered variant | ||
&--bordered { | ||
&.alert-default { | ||
--alert-text-color: theme('colors.neutral.800'); | ||
} | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import VAlert from './VAlert.vue'; | ||
import './VAlert.dark.scss'; | ||
|
||
export {VAlert}; | ||
export default VAlert; |
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,9 @@ | ||
.dark { | ||
.app-bar { | ||
&-default { | ||
--app-bar-bg-color: theme('colors.neutral.800'); | ||
--app-bar-color: theme('colors.neutral.200'); | ||
--app-bar-border-color: theme('borderColor.neutral.700'); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
|
||
// sticky | ||
&--sticky { | ||
position: 'sticky'; | ||
position: sticky; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
|
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import VAppBar from './VAppBar.vue'; | ||
import './VAppBar.dark.scss'; | ||
|
||
export * from './types'; | ||
export {VAppBar}; | ||
|
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,49 @@ | ||
.dark { | ||
.autocomplete { | ||
// field | ||
--v-autocomplete-field-bg-color: theme('colors.neutral.800'); | ||
--v-autocomplete-field-border-color: theme('borderColor.neutral.700'); | ||
|
||
// field hover | ||
--v-autocomplete-field-hover-border-color: theme('borderColor.neutral.800'); | ||
|
||
// input | ||
--v-autocomplete-input-color: theme('colors.neutral.600'); | ||
|
||
// input selected | ||
--v-autocomplete-input-selected-color: theme('colors.neutral.200'); | ||
|
||
// clearable button | ||
--v-autocomplete-clearable-button-color: theme('colors.neutral.400'); | ||
|
||
// clearable button hover | ||
--v-autocomplete-clearable-button-hover-color: theme('colors.neutral.500'); | ||
--v-autocomplete-clearable-button-hover-bg-color: theme( | ||
'colors.neutral.500' | ||
); | ||
|
||
// icon | ||
--v-autocomplete-icon-color: theme('colors.neutral.400'); | ||
|
||
// options | ||
--v-autocomplete-options-bg-color: theme('colors.neutral.800'); | ||
|
||
// empty | ||
--v-autocomplete-empty-color: theme('colors.neutral.700'); | ||
|
||
// item | ||
--v-autocomplete-item-color: theme('colors.neutral.200'); | ||
|
||
// item selected | ||
--v-autocomplete-item-selected-color: theme('colors.primary.500'); | ||
|
||
// item selected item | ||
--v-autocomplete-item-selected-icon-color: theme('colors.primary.500'); | ||
|
||
// item inactive | ||
--v-autocomplete-item-inactive-color: theme('colors.neutral.200'); | ||
|
||
// item active | ||
--v-autocomplete-item-active-bg-color: theme('colors.neutral.700'); | ||
} | ||
} |
Oops, something went wrong.