UNPKG

743 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports["default"] = wordWrap;
5/**
6 * Provides an easy way to change the `wordWrap` property.
7 *
8 * @example
9 * // Styles as object usage
10 * const styles = {
11 * ...wordWrap('break-word')
12 * }
13 *
14 * // styled-components usage
15 * const div = styled.div`
16 * ${wordWrap('break-word')}
17 * `
18 *
19 * // CSS as JS Output
20 *
21 * const styles = {
22 * overflowWrap: 'break-word',
23 * wordWrap: 'break-word',
24 * wordBreak: 'break-all',
25 * }
26 */
27function wordWrap(wrap) {
28 if (wrap === void 0) {
29 wrap = 'break-word';
30 }
31 var wordBreak = wrap === 'break-word' ? 'break-all' : wrap;
32 return {
33 overflowWrap: wrap,
34 wordWrap: wrap,
35 wordBreak: wordBreak
36 };
37}
38module.exports = exports.default;
\No newline at end of file