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

Adds wrapper around Widon’t breaking space #26

Merged
merged 2 commits into from
Aug 10, 2015

Conversation

kennethormandy
Copy link
Contributor

@kennethormandy kennethormandy commented Jun 22, 2015

This pull request adds a span around the   generated for stopping trailing words, similar to the .ord and .amp classes. This allows you to use the breaking space differently depending on the media query, for example:

.widont {
  display: inline-block; /* Ignore the breaking space */
  outline: 1px solid blue;
}

@media (min-width: 35em) {
  .widont {
    display: inline; /* Restore the breaking space at larger screen sizes */
    outline: 1px solid purple;
  }
}

This works really well for mobile first styling, where you only opt-into the feature at larger breakpoints. I don’t think individual trailing words were ever seen as a thing to be avoided 100% of the time—something you’ve already accounted for really well by scoping it to certain elements. This just goes one step further and allows you to decide whether or not widows should be avoided depending on the current line length or break point.

ekalinin added a commit that referenced this pull request Aug 10, 2015
Adds wrapper around Widon’t breaking space
@ekalinin ekalinin merged commit 4ae5ccc into ekalinin:master Aug 10, 2015
@ekalinin
Copy link
Owner

Thanks!

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