refactor(ui): replaced naive ui cards with custom ones

This commit is contained in:
Corentin Thomasset 2023-04-20 20:49:28 +02:00 committed by Corentin THOMASSET
parent bb32513bd3
commit f080933d2a
40 changed files with 351 additions and 303 deletions

View 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
View 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>