-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Doc Blocks: Fix styling and parameter bugs #20803
Conversation
Would that fix #20780? |
@JReinhold I see font-weight 700 on h2s in autodocs? |
Uh... I don't? Neither on next nor in this branch. This is from the published SB in this branch. |
Co-authored-by: Tom Coleman <[email protected]>
@tmeasday I've added a commit that fixes #20745, and reacted to your feedback, could you re-review? in essence I added (I've changed If we wanted a more proper solution for this we should probably stop rendering the same story twice in autodocs and instead generate a virtual story that we'd reference to ensure they don't collide. But I don't think now is the time for that. |
@JReinhold the rest of the changes look good, but I don't think 16eb696 is the right fix here. It would be an issue if you a) changed the args Then the primary story would render & emit with the updated args, and the second render would use + emit the story's Maybe pull that commit into a second PR and let's discuss further there? The solution suggested by @shilman was to somehow add an extra description prop to the <Story of={...} sourceLabel="primary" />
<Source of={...} sourceLabel="primary" /> WDYT about that? (don't love the name |
You're right, I missed that.
Deal!
So sort of like having a "sub story id" to key and get sources by, I think that makes sense. I don't know if it should be hardcoded by the rendering components, or if we should just generate a uuid to use instead. |
Are you imagining each I'm also wondering if (one day) we might also allow more than one set of arg values for the same story. We could use a similar "sub story id" concept to disambiguate the events. So the |
@tmeasday I changed all stories for blocks to be decorated by the This does add some unnecessary margin to all the stories, but I think that's a fine tradeoff. pixels are free. (Chromatic snapshots are acting up here, have reported) |
Closes #20850
What I did
This PR fixes a few outstanding bugs with docs and blocks.
parameters.docs.canvas.withToolbar = false
- they do now.There's still a difference in header styles between autodocs and manual docs, specifically I've noticed that
h2
in autodocs have font-weight 400, while they have font-weight 700 in manual docs. font-weight 400 is a global style we set at the manager level via Emotion, and I can't figure out why that global style is not set in manual docs. It's not because it's overwritten, it is never there.If anyone has inputs to this let me know.
How to test
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]