Skip to content

Combine wrap-normal and break-normal, rename wrap-break to break-words #763

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

Merged
merged 1 commit into from
Mar 14, 2019

Conversation

adamwathan
Copy link
Member

@adamwathan adamwathan commented Mar 14, 2019

In #571 we added a .break-all utility and renamed .break-words to .wrap-break because we decided it made sense to have .wrap-normal and .break-normal as separate "reset" utilities, since they target different properties.

In practice I think this is wasting an opportunity to make things easier for the end user, so this PR tweaks things so that wrap-break is back to .break-words, and .break-normal now resets both word-break and overflow-wrap.

In my testing there are no situations where it ever makes sense to add break-words and break-all to the same element, because break-all always takes precedence, so we might as well treat these like they are manipulating the same property and provide a little normalization for the end user.

Here's a more readable diff:

- .wrap-normal {
-   overflow-wrap: normal;
- }
- .wrap-break {
-   overflow-wrap: break-word;
- }
- .break-normal {
-   word-break: normal;
- }
- .break-all {
-   word-break: break-all;
- }
+ .break-normal {
+   overflow-wrap: normal;
+   word-break: normal;
+ }
+ .break-words {
+   overflow-wrap: break-word;
+ }
+ .break-all {
+   word-break: break-all;
+ }

This preserves backwards compatibility with Tailwind 0.x and provides some useful normalization on top of these two funky ass properties.
@adamwathan adamwathan merged commit 8694b07 into next Mar 14, 2019
@adamwathan adamwathan deleted the simplify-word-break branch March 14, 2019 13:09
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.

1 participant