Add word-wrap mixin

This commit is contained in:
Mark Perkins
2012-09-04 09:26:34 +01:00
parent 4153ea73af
commit 4da47852d7
2 changed files with 33 additions and 0 deletions

View File

@@ -494,6 +494,7 @@ Typography
* [@base-font-size](#setting-base-font-size)
* [.font-size-ems()](#font-size-ems)
* [.font-size-rems()](#font-size-rems)
* [.word-wrap()](#word-wrap)
### SETTING: @base-font-size
@@ -578,6 +579,30 @@ Future versions of this may include workarounds to make this more flexible.
}
```
### .word-wrap()
Implement word-wrapping for text within the element, with hyphenation where supported. See [http://blog.kenneth.io/blog/2012/03/04/word-wrapping-hypernation-using-css/](Kenneth Auchenberg's blog post) for details.
```css
.word-wrap();
```
```css
/* Usage: */
.example {
.word-wrap();
}
/* Example output: */
.example {
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
```
Sprites
-------

View File

@@ -37,3 +37,11 @@
}
}
.wrap-words() {
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}