The problem you are hitting in to, when de-skewing only one <p>
element is that element will always be treated as a square block. Meaning that each new line renders vertically down, rather than following the skewed edge of the parent. To get around this, you just need to break up the paragraph into smaller individual inline blocks.
Doing this manually is not great, which is why I would recommend a layer of script to do it (which should be easy to put together using a cross-browser lib, and something that can target TextNodes e.g. How do I select text nodes with jQuery?). However, you also wouldn't want to use this approach for large amounts of text — as it will incur a lot of processing for the browser. Both in CSS and JS:
.skew {
width: 400px;
transform: skew(-20deg);
background: red;
}
.skew > span {
display: inline-block;
transform: skew(20deg);
}
<div class="skew">
<span>This</span> <span>is</span> <span>lots</span>
<span>of</span> <span>text</span>. <span>This</span>
<span>is</span> <span>lots</span> <span>of</span>
<span>text</span>. <span>This</span> <span>is</span>
<span>lots</span> <span>of</span> <span>text</span>.
<span>This</span> <span>is</span> <span>lots</span>
<span>of</span> <span>text</span>. <span>This</span>
<span>is</span> <span>lots</span> <span>of</span>
<span>text</span>. <span>This</span> <span>is</span>
<span>lots</span> <span>of</span> <span>text</span>.
<span>This</span> <span>is</span> <span>lots</span>
<span>of</span> <span>text</span>. <span>This</span>
<span>is</span> <span>lots</span> <span>of</span>
<span>text</span>. <span>This</span> <span>is</span>
<span>lots</span> <span>of</span> <span>text</span>.
</div>
The other downside to the approach is that once you have broken things up, you can no longer rely on wrapping block elements for padding/margin. You can obviously still handle vertical spacing using specifically placed block elements i.e. headers or specific classes. E.g.
<h1>Title</h1>
<span>Word</span> <span>word</span> <span>word</span>
<span class="break"></span>
<span>Word</span> <span>word</span> <span>word</span>
So not an ideal solution either, but at runtime it does only require CSS, which is a positive.
It would be great if more things supported shape-outside
https://developer.mozilla.org/en/docs/Web/CSS/shape-outside
Unfortunately the CSS shapes specification seems to be taking a while to be implemented.
https://www.w3.org/TR/css-shapes-1