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

Dropdown should have a top margin of 0.5px #163

Closed
huyenltnguyen opened this issue May 31, 2024 · 6 comments · Fixed by #208
Closed

Dropdown should have a top margin of 0.5px #163

huyenltnguyen opened this issue May 31, 2024 · 6 comments · Fixed by #208
Labels
help wanted Open for all. You do not need permission to work on these. type: bug Something isn't working

Comments

@huyenltnguyen
Copy link
Member

Description

The Button component has a top margin of 0.5px while Dropdown doesn't. When Button and Dropdown are used together:

  • On desktop, there is a slight difference in the spacing
  • On mobile, there is a slight misalignment
Desktop Mobile
Screenshot 2024-05-31 at 15 35 47 Screenshot 2024-05-31 at 15 41 19

Page tested: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code

Changes needed

To address the issue, I think Dropdown should have a 0.5px top margin.

Though we might want to revisit this in the future, Button or Dropdown probably shouldn't have any margin, and their parent should be responsible for the layout (ref #13).

@huyenltnguyen huyenltnguyen added type: bug Something isn't working help wanted Open for all. You do not need permission to work on these. labels May 31, 2024
@a2937
Copy link
Member

a2937 commented Jun 1, 2024

Excuse me, I have a silly question. How do I test my solution?

@huyenltnguyen
Copy link
Member Author

huyenltnguyen commented Jun 3, 2024

You can run pnpm storybook, access the Storybook page at localhost:6006, find the Dropdown component and check if it has the expected styles.

@a2937
Copy link
Member

a2937 commented Jun 3, 2024

Console screenshot

I don't seem to have everything I need installed to run Storybook though. Where can I get it?

@huyenltnguyen
Copy link
Member Author

That's strange.

I'm sorry if this is too obvious, but did you run pnpm i after cloning the repo / before running pnpm storybook?

@a2937
Copy link
Member

a2937 commented Jun 3, 2024

image

Yes. And I am also using pnpm version 9.1.2 if that helps.

And node v20.13.1

@a2937
Copy link
Member

a2937 commented Jun 3, 2024

I didn't see those addons listed in package.json directly either, but it's fairly probably that it must have been bundled with something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants