-
Notifications
You must be signed in to change notification settings - Fork 15
fix: callout styling #891
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
fix: callout styling #891
Conversation
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.
Tried this locally and it's working great save for one edge case I noticed.
| {empty || React.Children.toArray(children)[0]} | ||
| </h3> | ||
| {empty ? children : React.Children.toArray(children).slice(1)} | ||
| {React.Children.toArray(children).slice(1)} |
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.
Why do we not need this ternary logic anymore? Is it possibly related to this discrepancy?
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.
It was a little simpler to leave the title/heading as an empty child. But we could just as easier refactor the code not to.
components/Callout/style.scss
Outdated
| border-color: var(--border); | ||
| color: var(--text); | ||
| padding: $l-offset; | ||
| min-height: 3 * $l-offset; |
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.
Hmmm, interesting that we need to set a minimum height at all here… (And also kinda strange to see this left offset var being used to set the height!)
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.
Probably not a huge deal, but it does suggest that there was some underlying change to the callout markup? It'd be nice to know what that is/why it broke the layout!
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 is/was actually a pre-existing condition? Perhaps it was a regression I introduced, but it is happening in core @readme/markdown.
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.
Ahhh, I see, I see… Unlikely to be something you introduced though! I probably just never tested my original CSS against an entirely empty callout since it’s (technically) not a case that we support.
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.
Interesting—even GitHub doesn't handle empty quotes particularly gracefully… Check it out:
Honestly, thinking about it a little harder now, there shouldn't really ever be a scenario where you'd have an empty callout. Maybe we can just remove this line entirely?
| min-height: 3 * $l-offset; |
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.
A+
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 PR was released!🚀 Changes included in v6.75.0-beta.45 |

🧰 Changes
Fixes empty header callout styling.
🧬 QA & Testing