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

IconRenderer: Support sizing & alignment of custom icons #1185

Merged
merged 4 commits into from Nov 16, 2022

Conversation

michaeltaranto
Copy link
Contributor

Provides support for sizing and aligning custom icons with Braid’s typographic components. The new IconRenderer component supports being used within Text and Heading components as well as inside icon slots of other components.

Uses the render prop pattern to provide the required classes to style and align a custom icon.

EXAMPLE USAGE:

<Heading level="1">
  <IconRenderer>
    {({ className }) => (
      <svg className={className}>
        ...
      </svg>
    )}
  </IconRenderer>
</Heading>

@michaeltaranto michaeltaranto requested a review from a team as a code owner November 15, 2022 10:20
@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2022

🦋 Changeset detected

Latest commit: 09a1786

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
braid-design-system Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

michaeltaranto and others added 3 commits November 16, 2022 09:12
Co-authored-by: Adam Skoufis <askoufis@users.noreply.github.com>
Co-authored-by: Adam Skoufis <askoufis@users.noreply.github.com>
Copy link
Contributor

@askoufis askoufis left a comment

Choose a reason for hiding this comment

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

👁️ 🌽

Copy link
Collaborator

@mrm007 mrm007 left a comment

Choose a reason for hiding this comment

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

Very elegant solution 🎩

@michaeltaranto michaeltaranto merged commit 2f144b4 into master Nov 16, 2022
@michaeltaranto michaeltaranto deleted the iconrenderer branch November 16, 2022 00:48
@seek-oss-ci seek-oss-ci mentioned this pull request Nov 16, 2022
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.

None yet

3 participants