Skip to content
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

Allow option to preserve whitespace for Typography content #577

Merged

Conversation

dasfrosty
Copy link
Contributor

Changes

Add support to Typography component for setting white-space CSS property.

Screenshots

For example:

Screenshot 2024-10-22 at 4 06 41 PM

Copy link

changeset-bot bot commented Oct 22, 2024

🦋 Changeset detected

Latest commit: 16d4add

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cambly/syntax-core Minor
@syntax/storybook Patch

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

Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
syntax ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 4:54pm

*
* @defaultValue "inherit"
*/
whiteSpace?:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. generally, we've limited alot of these props to only the ones we need. ive inherited christian's rather be more strict and then if we need the others ones we'll add it later

how often do you think we'll need all of these?
i imagine just inherit, normal, nowrap and pre will be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the current use case we want pre-line so that we can preserve line breaks but still wrap.
Screenshot 2024-10-22 at 5 15 10 PM

I'll limit it to inherit, normal, nowrap and pre-line for now.

Unless you think there's a use case for pre as well:

Screenshot 2024-10-22 at 5 07 51 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the ones you mentioned are fine. thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the ones you mentioned are fine. thanks!

Done!

@dasfrosty dasfrosty force-pushed the niels/typography-preserve-line-breaks-option branch from 1e84c7d to 16d4add Compare October 24, 2024 16:54
@dasfrosty dasfrosty merged commit f6cf4fc into Cambly:main Oct 24, 2024
10 checks passed
@dasfrosty dasfrosty deleted the niels/typography-preserve-line-breaks-option branch October 24, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants