-
Notifications
You must be signed in to change notification settings - Fork 54
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
Update Do/Don't component API #184
Conversation
This pull request is being automatically deployed with Vercel (learn more). doctocat – ./🔍 Inspect: https://vercel.com/primer/doctocat/muh2rr2cb gatsby-theme-primer-example – ./🔍 Inspect: https://vercel.com/primer/gatsby-theme-primer-example/3fdx9al0k |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 this seams reasonable!
FYI I'm going to hold off on merging this until I have changesets set up in this repo so I can test out the release process. |
🦋 Changeset detectedLatest commit: ea38980 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
Problem
While creating design guidelines for Octicons, I ran into limitations with the Do/Don't component API that prevented me from rendering do/don't examples as I wanted.
I didn't want the images to scale to fill all the available space because I wanted to avoid the 1px grid lines appearing blurry. Instead, I wanted the images to keep their natural width and be centered inside a container with the same background color:
The current Do/Don't component API, however, did not allow me to control how images are rendered:
Solution
I updated the Do/Don't component API to allow consumers to control how images are rendered:
This API allows me to create the Octicons design guidelines do/don't example (pictured above) like so:
This API also allows people to create do/don't examples with more than just images. For example, using code in do/don't examples could be useful in CLI guidelines: