Center preview content in docs example previews - #42852
Open
mdo wants to merge 3 commits into
Open
Conversation
Wrap example preview markup in a `.bd-example-content` element so the frame can center content on both axes and apply a min-height. Loose inline items (buttons, badges, links) center in a row, while block components keep their own text alignment and get centered horizontally. Retarget the StackBlitz export to the new wrapper so exported markup and author classes stay correct.
Put justify-content before text-align and use a single :not().
Add `align-items: center` to `.bd-example-content` so examples that turn the wrapper into a flexbox (`d-flex`, `vstack`, `hstack`) center their items horizontally, instead of sitting left in the tall min-height frame. Exclude grid wrappers so grid items keep stretching to equal heights.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.bd-example-contentelement so the.bd-exampleframe can center content on both axes and apply amin-height..row/grid keep their negative gutters.classvalues move to the content wrapper;justify-content: centercentersd-flex/vstackrows, and utilities still override it.