mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 01:06:15 -04:00
refactor(ui): replaced naive ui cards with custom ones
This commit is contained in:
parent
bb32513bd3
commit
f080933d2a
40 changed files with 351 additions and 303 deletions
12
src/ui/c-card/c-card.theme.ts
Normal file
12
src/ui/c-card/c-card.theme.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { defineThemes } from '../theme/theme.models';
|
||||
|
||||
export const { useTheme } = defineThemes({
|
||||
dark: {
|
||||
backgroundColor: '#232323',
|
||||
borderColor: '#282828',
|
||||
},
|
||||
light: {
|
||||
backgroundColor: '#ffffff',
|
||||
borderColor: '#efeff5',
|
||||
},
|
||||
});
|
35
src/ui/c-card/c-card.vue
Normal file
35
src/ui/c-card/c-card.vue
Normal file
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<div class="c-card">
|
||||
<div v-if="title" class="c-card-title">
|
||||
{{ title }}
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useTheme } from './c-card.theme';
|
||||
|
||||
const props = defineProps<{
|
||||
title?: string;
|
||||
}>();
|
||||
|
||||
const { title } = toRefs(props);
|
||||
|
||||
const theme = useTheme();
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.c-card {
|
||||
background-color: v-bind('theme.backgroundColor');
|
||||
border: 1px solid v-bind('theme.borderColor');
|
||||
border-radius: 4px;
|
||||
padding: 20px 24px;
|
||||
|
||||
&-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue