monks/white_space_collapse
The white-space-collapse CSS property controls how {{Glossary(“whitespace”, “white space”)}} inside an element is collapsed.
The
white-space-collapseand {{CSSxRef(“text-wrap-mode”)}} properties can be declared together using the {{CSSxRef(“white-space”)}} shorthand property.
Values
pub const break_spaces: #(String, String)
- : The behavior is identical to
preserve, except that: - Any sequence of preserved white space always takes up space, including at the end of the line. - A line-breaking opportunity exists after every preserved white space character, including between white space characters. - Preserved spaces take up space and do not hang, thus affecting the box’s intrinsic sizes ({{cssxref(“min-content”)}} size and {{cssxref(“max-content”)}} size).> [!NOTE]> Segment break characters are characters such as line feeds that cause text to break onto new lines.> [!NOTE]> The CSS text module defines adiscardvalue for thewhite-space-collapseproperty to discard all white space in the element, however, this is not supported in any browsers.
pub const preserve: #(String, String)
- : White space sequences and segment break characters are preserved.
pub const preserve_breaks: #(String, String)
- : White space sequences are collapsed, while segment break characters are preserved.
pub const preserve_spaces: #(String, String)
- : White space sequences are preserved, while tabs and segment break characters are converted to spaces.
pub fn raw(value: String) -> #(String, String)
Enter a raw string value for white-space-collapse
pub const revert_layer: #(String, String)