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

fix: bills explore table styles #161

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions src/routes/bills/explore/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,19 @@
</div>
<svelte:fragment slot="table" let:cellKey let:cellValue>
{#if cellKey === 'proposedOn'}
<span class="body-compact-01 text-gray-60"
>{new Date(cellValue).toLocaleString('th-TH', {
<div class="body-compact-01 w-20 text-gray-60">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We better not fix the width, because some users might set font size higher than usual (my parents did) and fixing the width won't guarantee that text will be in the same line.

I suggest you to use whitespace-nowrap (CSS white-space: nowrap;) instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed the point, and I understand your concerns. I’ve encountered many users who use a large font size on their machines.

I can ensure that w-20 (which applies width: 5rem) will be responsive to the browser's root font size because it uses rem.

Therefore, should I add whitespace-nowrap and adjust the width for the cell?
If you have any specific preferences such as width, please let me know.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point, however, I still suggest using nowarp solution. Because it will guarantee that the cell width will just fit the one-line text, no more no less. And no need for us to try picking the closest width that works.

{new Date(cellValue).toLocaleString('th-TH', {
day: 'numeric',
month: 'short',
year: '2-digit'
})}</span
>
})}
</div>
{:else if cellKey === 'titleColumn'}
<a class="text-text-01 underline hover:text-interactive-01" href="/bills/{cellValue.id}"
>{cellValue.title}</a
>
{:else if cellKey === 'status'}
<BillStatusTag status={cellValue} isLarge />
<BillStatusTag class="m-0" status={cellValue} isLarge />
{:else if cellValue}
<a href={cellValue.url} title={cellValue.label} target="_blank" rel="noopener noreferrer">
<DocumentPdf />
Expand Down