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

Dont override md-classes when adding className prop to button and link #30

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

kajsaeggum
Copy link
Contributor

@kajsaeggum kajsaeggum commented Oct 26, 2023

Describe your changes

Changed order of applied props to button and link elements. Otherwise adding a className property when using MdLink or MdButton component will effectively remove the internal classes that style them correctly.

Also made sure that the resulting classes added on the element include both the internal classes and any applied from the outside, so that it is possible to further style the component where it is being used.

NB: If allowing users of the component library to extend styling in this way is accepted, the same logic should be added to all the components, not just MdLink and MdButton as I've done here.

Checklist before requesting a review

  • I have performed a self-review and test of my code
  • If new component: Is story for component created in stories-folder?
  • If new component: Is tsx-file import added to packages/react/index.tsx?
  • If new component: Is css-file added to packages/css/index.css?

@kajsaeggum kajsaeggum requested review from Jaanesen and a team as code owners October 26, 2023 13:15
@kajsaeggum kajsaeggum changed the title dont override md-classes when adding className prop to button and link Dont override md-classes when adding className prop to button and link Oct 26, 2023
Copy link
Contributor

@Jaanesen Jaanesen left a comment

Choose a reason for hiding this comment

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

Ser kjempefint ut, mangler også en package.json bump for å kunne legges inn i npm

Copy link
Contributor

@Jaanesen Jaanesen left a comment

Choose a reason for hiding this comment

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

👍💃

@Jaanesen Jaanesen merged commit 25e6c09 into miljodir:main Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants