ToggleTheme
This commit is contained in:
parent
683d4375ff
commit
b771d209ee
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "axp-ui",
|
"name": "axp-ui",
|
||||||
"descriiption": "My helper ui lib",
|
"descriiption": "My helper ui lib",
|
||||||
"version": "1.6.1",
|
"version": "1.6.2",
|
||||||
"homepage": "https://antoxahub.ru/antoxa/axp-ui",
|
"homepage": "https://antoxahub.ru/antoxa/axp-ui",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
21
src/components/ToggleTheme.vue
Normal file
21
src/components/ToggleTheme.vue
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import UiIcon from './Icon.vue'
|
||||||
|
|
||||||
|
// Props.
|
||||||
|
const props = defineProps<{
|
||||||
|
dark?: boolean
|
||||||
|
}>()
|
||||||
|
|
||||||
|
// Emits.
|
||||||
|
const emit = defineEmits<{ (e: 'update:dark', v: boolean): void }>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="ui-toggle-theme">
|
||||||
|
<ui-icon
|
||||||
|
:name="props.dark ? 'moon' : 'sun'"
|
||||||
|
@click="emit('update:dark', !props.dark)"
|
||||||
|
title="Переключить тему"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -17,3 +17,4 @@ export { default as UiForm } from './Form.vue'
|
|||||||
export { default as UiCard } from './Card.vue'
|
export { default as UiCard } from './Card.vue'
|
||||||
export { default as UiTable } from './Table.vue'
|
export { default as UiTable } from './Table.vue'
|
||||||
export { default as UiDialog } from './Dialog.vue'
|
export { default as UiDialog } from './Dialog.vue'
|
||||||
|
export { default as UiToggleTheme } from './ToggleTheme.vue'
|
||||||
|
@ -1,24 +1,31 @@
|
|||||||
body
|
// Layouts.
|
||||||
@apply text-dark
|
.layout
|
||||||
|
@apply flex flex-col h-full
|
||||||
|
@apply min-w-[320px]
|
||||||
|
min-height: 100vh
|
||||||
|
overflow: hidden
|
||||||
*
|
*
|
||||||
@apply text-base
|
@apply text-base
|
||||||
|
main
|
||||||
|
@apply flex flex-col flex-1
|
||||||
|
|
||||||
h1
|
h1
|
||||||
@apply text-xl md:text-2xl font-bold
|
@apply text-xl md:text-2xl font-bold
|
||||||
h2
|
h2
|
||||||
@apply text-lg md:text-xl font-bold
|
@apply text-lg md:text-xl font-bold
|
||||||
h3
|
h3
|
||||||
@apply text-base md:text-lg font-bold
|
@apply text-base md:text-lg font-bold
|
||||||
h4
|
h4
|
||||||
@apply text-sm md:text-base font-bold
|
@apply text-sm md:text-base font-bold
|
||||||
|
|
||||||
p
|
p
|
||||||
&:not(:last-child)
|
&:not(:last-child)
|
||||||
@apply mb-4
|
@apply mb-4
|
||||||
|
|
||||||
.title
|
.title
|
||||||
@apply mb-4
|
@apply mb-4
|
||||||
|
|
||||||
|
// Ui.
|
||||||
.ui
|
.ui
|
||||||
&-btn,
|
&-btn,
|
||||||
&-field .input
|
&-field .input
|
||||||
@ -133,3 +140,6 @@ p
|
|||||||
@apply text-dark
|
@apply text-dark
|
||||||
&-content
|
&-content
|
||||||
@apply p-3
|
@apply p-3
|
||||||
|
&-toggle-theme
|
||||||
|
.ui-icon
|
||||||
|
@apply cursor-pointer
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
// Layouts.
|
||||||
|
.layout
|
||||||
|
@apply bg-light/10 text-dark
|
||||||
|
@apply dark:bg-black dark:text-light
|
||||||
|
*
|
||||||
|
@apply border-light dark:border-light/40
|
||||||
|
a
|
||||||
|
@apply text-primary
|
||||||
|
|
||||||
|
// body
|
||||||
|
// *
|
||||||
.ui
|
.ui
|
||||||
&-btn,
|
&-btn,
|
||||||
&-alert
|
&-alert
|
||||||
@ -23,7 +34,7 @@
|
|||||||
|
|
||||||
&-field
|
&-field
|
||||||
.input
|
.input
|
||||||
@apply bg-white text-dark
|
@apply bg-white dark:bg-white/10 text-dark dark:text-white
|
||||||
&.error
|
&.error
|
||||||
.label,
|
.label,
|
||||||
.input,
|
.input,
|
||||||
|
Loading…
Reference in New Issue
Block a user