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

Use max-width instead of width for tag name #219

Merged
merged 1 commit into from
Nov 29, 2022
Merged

Conversation

SimonLab
Copy link
Member

Use max width for tag name
see: #217 (comment)

@SimonLab SimonLab requested a review from nelsonic November 29, 2022 14:28
@SimonLab SimonLab added the awaiting-review An issue or pull request that needs to be reviewed label Nov 29, 2022
@@ -13,7 +13,7 @@
<.td>
<span
style={"background-color:#{tag.color}"}
class="w-40 text-white font-bold py-1 px-2 rounded-full
class="max-w-[144px] text-white font-bold py-1 px-2 rounded-full
Copy link
Member

Choose a reason for hiding this comment

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

Hmm… why 144px? Is this tested on any mobile devices? 📱

Copy link
Member Author

Choose a reason for hiding this comment

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

yes tested on mobile.
I've take the value to match the m-36 (m-40 was a bit too long I think)
image

https://tailwindcss.com/docs/width

Copy link
Member

Choose a reason for hiding this comment

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

OK. so you had to hard-code it because max-w-xs is 320px 💭
image

Copy link
Member Author

Choose a reason for hiding this comment

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

So yes, I started tested with max-w-xs, it was looking ok on desktop:
image

However when I tested on mobile, the table wasn't displayed in full:

image

I knew with my previous PR(#218) that using the fixed width w-40 the display of the table was working on both desktop and mobile.

However Tailwind doesn't provide the max-w-40. I found the arbitrary value section in the documentation and decided to use then the max-w-[160px] first to match the w-40. However I still find the table/tag pills a bit too long and went with max-w-[144px] to match the w-36

Test describe in the comment #217 (comment) while I was doing the work on the PR

Copy link
Member

Choose a reason for hiding this comment

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

Cool. Thanks for sharing more detail. 👌

Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

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

Happy to merge as this shouldn’t “break” anything. But still curious why you’re hard-coding in pixels. 💭

@nelsonic nelsonic merged commit cb01a7b into main Nov 29, 2022
@nelsonic nelsonic deleted the max-width-tag-#217 branch November 29, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants