You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for Text listed whiteSpace as a supported prop, but the component did not actually accept it, resulting in a type error when used. This PR adds first-class support for the whiteSpace prop so the implementation matches the documentation.
The prop maps to the CSS white-space property via a data-white-space attribute and supports the values pre, normal, nowrap, pre-wrap, and pre-line.
Changelog
New
Added a whiteSpace prop to the Text component that controls the CSS white-space property. Supported values: pre, normal, nowrap, pre-wrap, pre-line.
Added Storybook feature stories for each whiteSpace value and a whiteSpace control to the Text playground.
Changed
Text now renders a data-white-space attribute and applies the corresponding white-space styling in Text.module.css.
Removed
N/A
Rollout strategy
Patch release
Minor release
Major release; if selected, include a written rollout or migration plan
None; if selected, include a brief description as to why
Testing & Reviewing
Added unit tests verifying the data-white-space attribute is set for each supported value and is omitted when the prop is not provided.
Verify the new whiteSpace stories in Storybook (Components → Text → Features) render the expected white-space behavior.
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.
To publish a canary release for integration testing, apply the Canary Release label to this PR.
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
Canary ReleaseApply this label when you want CI to create a canary release of the current PRintegration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor is a staff member
3 participants
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.
Closes #7607
The docs for
TextlistedwhiteSpaceas a supported prop, but the component did not actually accept it, resulting in a type error when used. This PR adds first-class support for thewhiteSpaceprop so the implementation matches the documentation.The prop maps to the CSS
white-spaceproperty via adata-white-spaceattribute and supports the valuespre,normal,nowrap,pre-wrap, andpre-line.Changelog
New
whiteSpaceprop to theTextcomponent that controls the CSSwhite-spaceproperty. Supported values:pre,normal,nowrap,pre-wrap,pre-line.whiteSpacevalue and awhiteSpacecontrol to the Text playground.Changed
Textnow renders adata-white-spaceattribute and applies the correspondingwhite-spacestyling inText.module.css.Removed
Rollout strategy
Testing & Reviewing
data-white-spaceattribute is set for each supported value and is omitted when the prop is not provided.whiteSpacestories in Storybook (Components → Text → Features) render the expectedwhite-spacebehavior.Merge checklist