Options: textSpaces on split="wrapped"
The textSpaces option determines how spaces will be treated on the text. When using split="text" you have the following options:
textSpaces="style" (default)
If you do not specify a textSpaces option, the default: textSpaces="style"
is used. Spaces are encapsulated in a span that is itself encapsulated in another span with class="gt-word"
(so that they can be styled by outside CSS rules) and styled.
Example
ALTERNATING COLORED SEGMENTS on the magazine’s spine make WIRED recognizable on nearly any bookshelf.
var rules = {
color: {
values: ["#FB3126", "#15B5B4"],
steps: true,
},
backgroundColor: {
values: ["#15B5B4", "#FB3126"],
steps: true,
}
}
var wiredSpineText = new generativeText(rules);
wiredSpineText.applyToElementById("example1");
#example1 span.gt-word span { width: 1.5em; text-align: center; margin-bottom: 0.2em; }
textSpaces="nostyle"
Spaces are encapsulated in a double span but not styled. The space is counted when calculating styles.
Example
ALTERNATING COLORED SEGMENTS on the magazine’s spine make WIRED recognizable on nearly any bookshelf.
textSpaces="nostylenocount"
Spaces are encapsulated in a double span but not styled. The space is not counted when calculating styles.
Example
ALTERNATING COLORED SEGMENTS on the magazine’s spine make WIRED recognizable on nearly any bookshelf.
textSpaces="nostyleorwrap"
Spaces are not encapsulated in any span. They are replaced with a entity. The space is not counted when calculating styles.
Example
ALTERNATING COLORED SEGMENTS on the magazine’s spine make WIRED recognizable on nearly any bookshelf.
textSpaces="remove"
Spaces are removed.
Example
ALTERNATING COLORED SEGMENTS on the magazine’s spine make WIRED recognizable on nearly any bookshelf.