Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove custom style card and update style #364

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions apps/demo/src/views/UI/card/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,73 +133,9 @@
</Card>
</div>
</section>

<section>
<h2>{{ $t("ui.card.usage.customStyle") }}</h2>

<div class="section-content">
<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
&lt;Card class="custom-style-card"&gt;
&lt;template #header&gt;
&lt;h3&gt;Lorem ipsum&lt;/h3&gt;
&lt;/template&gt;
&lt;p&gt;
...
&lt;/p&gt;
&lt;template #footer&gt;
&lt;div class="footer"&gt;
...
&lt;/div&gt;
&lt;/template&gt;
&lt;/Card&gt;
&lt;/template&gt;

&lt;script setup lang="ts"&gt;
import { Card } from "@dzangolab/vue3-ui";
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->

<Card class="custom-style-card">
<template #header>
<h3 class="title">
{{ $t("ui.card.headerContent") }}
</h3>
</template>
<p class="content">
{{ $t("ui.card.content") }}
</p>
<template #footer>
<div class="footer">
{{ $t("ui.card.footerContent") }}
</div>
</template>
</Card>
</div>
</section>
</Page>
</template>

<script setup lang="ts">
import { Card } from "@dzangolab/vue3-ui";
</script>

<style lang="css">
.custom-style-card {
--_border-color: #555;
--_border-radius: 0.5rem;
--_box-shadow-color: rgba(0, 0, 0, 0.5);
}

.custom-style-card .card-header {
--_bg-color: #f5f5f5;
}

.custom-style-card .card-footer {
--_bg-color: #f5f5f5;
--_font-size: 0.9rem;
--_text-color: #555;
}
</style>
2 changes: 2 additions & 0 deletions packages/vue-ui/src/assets/css/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
--_border-color: var(--card-border-color, #ddd);
--_border-radius: var(--card-border-radius, 0.5rem);
--_box-shadow-color: var(--card-box-shadow-color, rgba(0, 0, 0, 0.1));
--_padding: var(--card-padding, 0.625rem);

border: 1px solid var(--_border-color);
border-radius: var(--_border-radius);
box-shadow: 0 2px 8px var(--_box-shadow-color);
overflow: hidden;
padding: var(--_padding);
}

.card-footer {
Expand Down
Loading