Skip to content
Snippets Groups Projects
Commit 88d645e5 authored by Tomi Valentová's avatar Tomi Valentová
Browse files

nicer table styles

parent ccd12c38
Branches
No related tags found
1 merge request!29Feat/redesign
Pipeline #19165 passed
<div class="__js-root"> <div class="__js-root">
<ui-popout-table sizing-classes="max-w-[100ch] w-full" :open-by-default="false"> <ui-popout-table sizing-classes="max-w-[100ch] w-full" :open-by-default="false">
<template slot="head"> <template slot="head">
<tr class="bg-black [&_*]:!text-white [&_*]:!pt-2"> <tr class="bg-black [&_*]:!text-white [&_p]:py-0 [&_p]:my-0 [&_>_th]:py-2">
<th>Company</th> <th>
<th>Contact</th> <p>
<th>Country</th> Company
</p>
</th>
<th>
<p>
Contact
</p>
</th>
<th>
<p>
Country
</p>
</th>
</tr> </tr>
</template> </template>
<template slot="body"> <template slot="body">
<tr> <tr>
<td>Alfreds Futterkiste</td> <td>
<td>Maria Anders</td> <p>
<td>Germany</td> Alfreds Futterkiste
</p>
</td>
<td>
<p>
Maria Anders
</p>
</td>
<td>
<p>
Germany
</p>
</td>
</tr> </tr>
<tr> <tr>
<td>Centro comercial Moctezuma</td> <td>
<td>Francisco Chang</td> <p>
<td>Mexico</td> Centro comercial Moctezuma
</p>
</td>
<td>
<p>
Francisco Chang
</p>
</td>
<td>
<p>
Mexico
</p>
</td>
</tr> </tr>
</template> </template>
</ui-popout-table> </ui-popout-table>
......
<div class="my-6 prose max-w-[100ch]"> <div class="my-6 prose max-w-[100ch]">
<table> <table>
<thead> <thead>
<tr class="bg-black [&_*]:!text-white [&_*]:!pt-2"> <tr class="bg-black [&_*]:!text-white [&_p]:py-0 [&_p]:my-0 [&_>_th]:py-2">
<th>Company</th> <th>Company</th>
<th>Contact</th> <th>Contact</th>
<th>Country</th> <th>Country</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody
class="
w-full duration-200 [&_p]:py-0 [&_p]:my-0 [&_td]:py-2 [&_td]:align-middle
[&_tr:nth-child(even)]:bg-grey-50
"
>
<tr> <tr>
<td>Alfreds Futterkiste</td> <td>Alfreds Futterkiste</td>
<td>Maria Anders</td> <td>Maria Anders</td>
...@@ -17,7 +22,11 @@ ...@@ -17,7 +22,11 @@
<tr> <tr>
<td>Centro comercial Moctezuma</td> <td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td> <td>Francisco Chang</td>
<td>Mexico</td> <td>
A<br>
B<br>
C<br>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
.flip-card { .flip-card {
.prose :where(p):not(:where([class~="not-prose"], [class~="not-prose"] *)) { &.prose :where(p):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.75rem; margin-top: 0.75rem;
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
} }
.prose :where(li):not(:where([class~="not-prose"], [class~="not-prose"] *)) { &.prose :where(li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.25rem; margin-top: 0.25rem;
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
......
<template> <template>
<table :class="'duration-200 my-6 prose ' + $props.sizingClasses"> <table :class="'duration-200 my-6 prose ' + $props.sizingClasses">
<slot name="caption"></slot>
<thead class="relative w-full duration-200"> <thead class="relative w-full duration-200">
<slot name="head"></slot> <slot name="head"></slot>
<div class="absolute top-0 right-[-60px]"> <div class="absolute top-0 right-[-60px]">
<button <button
ref="togglerButton" ref="togglerButton"
class="w-12 h-12 rounded-full bg-white hover:bg-grey-125 duration-150 flex justify-center items-center" class="w-10 h-10 rounded-full bg-white hover:bg-grey-125 duration-150 flex justify-center items-center"
@click="$data.isOpen = !$data.isOpen" @click="$data.isOpen = !$data.isOpen"
> >
<i <i
...@@ -23,7 +25,10 @@ ...@@ -23,7 +25,10 @@
<tbody <tbody
v-if="$data.isOpen" v-if="$data.isOpen"
class="w-full duration-200" class="
w-full duration-200 [&_p]:py-0 [&_p]:my-0 [&_td]:py-2 [&_td]:align-middle
[&_tr:nth-child(even)]:bg-grey-50
"
> >
<slot name="body"></slot> <slot name="body"></slot>
</tbody> </tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment