Skip to content

Commit 7869bcf

Browse files
MattDiMuMoOx
authored andcommitted
Added: overflow-wrap fallback (MoOx#280)
1 parent d6c2a33 commit 7869bcf

File tree

7 files changed

+35
-0
lines changed

7 files changed

+35
-0
lines changed

docs/content/features.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,20 @@ a::before {
392392
|
393393
[Plugin documentation](https://github.com/axa-ch/postcss-pseudoelements)
394394

395+
## `overflow-wrap` property (`word-wrap` fallback)
396+
397+
Converts `overflow-wrap` to `word-wrap` (many browser support only the old [word-wrap](http://caniuse.com/#feat=wordwrap) property).
398+
399+
```css
400+
body {
401+
overflow-wrap: break-word;
402+
}
403+
```
404+
405+
[Specification](https://drafts.csswg.org/css-text-3/#propdef-word-wrap)
406+
|
407+
[Plugin documentation](https://github.com/MattDiMu/postcss-replace-overflow-wrap)
408+
395409
## @todo
396410

397411
Any omissions of the CSS specifications (even in draft) that are subject to be

docs/content/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ title: cssnext - Use tomorrow’s CSS syntax, today.
126126
(<code>:</code> fallback)
127127
</small>
128128
</li>
129+
<li class="r-Grid-cell r-minS--1of2">
130+
<a href="/features/#replace-overflow-wrap"><code>overflow-wrap</code> property</a>
131+
<small class="cssnext-FeaturesList-small">
132+
(<code>word-wrap</code> fallback)
133+
</small>
134+
</li>
129135
</ul>
130136
<small
131137
class="cssnext-FeaturesList-small"

docs/content/playground.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
}
6262
.sepia {
6363
filter: sepia(.8);
64+
}
65+
66+
/* overflow-wrap fallback */
67+
body {
68+
overflow-wrap: break-word;
6469
}
6570

6671
</textarea>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"postcss-nesting": "^2.0.5",
4444
"postcss-pseudo-class-any-link": "^1.0.0",
4545
"postcss-pseudoelements": "^3.0.0",
46+
"postcss-replace-overflow-wrap": "^1.0.0",
4647
"postcss-selector-matches": "^2.0.0",
4748
"postcss-selector-not": "^2.0.0"
4849
},
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
overflow-wrap: break-word;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
word-wrap: break-word;
3+
}

src/features.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export default {
6666
// https://npmjs.com/package/postcss-color-rgba-fallback
6767
colorRgba: (options) => require("postcss-color-rgba-fallback")(options),
6868

69+
// https://www.npmjs.com/package/postcss-replace-overflow-wrap
70+
replaceOverflowWrap: (options) => require("postcss-replace-overflow-wrap")(options),
71+
6972
// https://npmjs.com/package/autoprefixer
7073
autoprefixer: (options) => require("autoprefixer")(options),
7174
}

0 commit comments

Comments
 (0)