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

Add examples of headings with icons #420

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

thibaudcolas
Copy link
Member

Description

Implements the new "headings with icons" pattern, via a utility class rather than a specific component. I chose this approach because it’s the simplest and seemed sufficient. The vertical alignment between the icon and text isn’t always perfect but I’d say it’s worth adjusting case-by-case based on the specific visuals of the icon.

Instructions to test

I’ve added two sets of examples:

  • In foundation stories, with a single icon that’s a good approximation of the kind of visual that could be next to a heading
  • In BaseHeading stories, with three different icons that represent different possible formats (high, wide, square)

@thibaudcolas thibaudcolas marked this pull request as ready for review August 21, 2023 07:56
@thibaudcolas thibaudcolas added the enhancement New feature or request label Aug 21, 2023
Copy link
Member

@Scotchester Scotchester left a comment

Choose a reason for hiding this comment

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

I think a case could be made for a default vertical alignment that is better than this, but it would necessitate some CSS like:

h3 svg.inline {
  position: relative;
  top: -0.0625em;
}

I reluctantly agree that it's probably not worth it right now; we'll see how widely these start to get used.

Approved pending an update for my nitpick.

storybook/stories/_docs/foundation_typography.stories.mdx Outdated Show resolved Hide resolved
Co-authored-by: Scott Cranfill <scott@scottcranfill.com>
@thibaudcolas
Copy link
Member Author

Thanks @Scotchester, yes I considered something like this but was hesitant to proceed without a good understanding of how appropriate this "default" would be across a wide enough range of icons / heading sizes.

@thibaudcolas thibaudcolas merged commit 5718531 into nasa-jpl:main Aug 30, 2023
1 check passed
@thibaudcolas thibaudcolas deleted the feature/heading-icons branch August 30, 2023 15:02
@Scotchester Scotchester added the minor Contains new features or enhancements label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Contains new features or enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants