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

refactor: various tags improvements #5386

Merged
merged 3 commits into from
Aug 20, 2021
Merged

refactor: various tags improvements #5386

merged 3 commits into from
Aug 20, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Aug 19, 2021

Motivation

Just some small improvements after merge #3646:

  • Using more semantic markup for all tags-related elements
  • Styling tags and tag list page to make them more attractive and noticeable
  • Reusing current translation for link to doc tag list

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview.

Tags:

image

Tag list:

image

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Aug 19, 2021
@lex111 lex111 requested a review from slorber as a code owner August 19, 2021 12:37
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 19, 2021
@netlify
Copy link

netlify bot commented Aug 19, 2021

✔️ [V2]

🔨 Explore the source changes: e2e1d4b

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/611ec2d9d20fcf00088bbaae

😎 Browse the preview: https://deploy-preview-5386--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Aug 19, 2021

Size Change: +1.63 kB (0%)

Total Size: 811 kB

Filename Size Change
website/build/assets/css/styles.********.css 94.9 kB +915 B (+1%)
website/build/blog/2017/12/14/introducing-docusaurus/index.html 65.4 kB +159 B (0%)
website/build/blog/index.html 35.7 kB +341 B (+1%)
website/build/tests/docs/index.html 24.1 kB +170 B (+1%)
website/build/tests/docs/standalone/index.html 21.9 kB +102 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 36.2 kB 0 B
website/build/assets/js/main.********.js 410 kB 0 B
website/build/docs/index.html 43.1 kB -26 B (0%)
website/build/docs/installation/index.html 50.7 kB -27 B (0%)
website/build/index.html 29.8 kB 0 B

compressed-size-action

@github-actions
Copy link

github-actions bot commented Aug 19, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 87
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5386--docusaurus-2.netlify.app/

@lex111
Copy link
Contributor Author

lex111 commented Aug 19, 2021

As an alternative (maybe better) option, we can use one single tag style regardless of target page. For example, on detail page of we had something like this:

image

Or like this (with additional heading, although if tags are styled as labels, it may not be necessary):

image

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

LGTM thanks

Feel free to merge as it's already an improvement compared to what we had.

https://deploy-preview-5386--docusaurus-2.netlify.app/tests/docs/tags/

What about:

  • Using a single design/comp, with an optional count prop? That would allow customizing it more easily.
  • Show tag count in a rectangle instead of a circle/oval

The arrow design is a bit too opinionated for me and I prefer something soberer, but it's probably my own tastes. As you want. In the doc page, it would probably be soberer without the count anyway so I don't know 🤪

The tag count in oval does not scale well to large numbers:

image

It may be worth increasing the font-weight of that count too?

@lex111
Copy link
Contributor Author

lex111 commented Aug 19, 2021

The arrow design is a bit too opinionated for me and I prefer something soberer, but it's probably my own tastes. As you want. In the doc page, it would probably be soberer without the count anyway so I don't know zany_face

Some time age I saw how other blogs style tag items in this way, it seemed to me interesting option, which could be applied to us.

@johnnyreilly you as blog user on Docusaurus, I want to hear your opinion on this redesign.

@johnnyreilly
Copy link
Contributor

I think this is a nice improvement. I don't actually use tags from the UI perspective a great deal, but I generally like this.

The tag count in oval does not scale well to large numbers:

I agree with @slorber on this point. However, in my experience, it's unlikely that numbers of that scale will naturally occur. So I don't think it's too much of an issue

@lex111
Copy link
Contributor Author

lex111 commented Aug 19, 2021

In the doc page, it would probably be soberer without the count anyway so I don't know

Actually, I myself can't decide if need to use arrow-style anywhere else besides tag list. So let's keep things as is.

Using a single design/comp, with an optional count prop? That would allow customizing it more easily.
Show tag count in a rectangle instead of a circle/oval

Just fixed all of the above.

@slorber
Copy link
Collaborator

slorber commented Aug 20, 2021

LGTM 👍 thanks

@slorber slorber merged commit 4339f74 into main Aug 20, 2021
@slorber slorber deleted the lex111/tags-improvements branch August 20, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants