monks/white_space_collapse

The white-space-collapse CSS property controls how {{Glossary(“whitespace”, “white space”)}} inside an element is collapsed.

The white-space-collapse and {{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 a discard value for the white-space-collapse property to discard all white space in the element, however, this is not supported in any browsers.
pub const collapse: #(String, String)
pub const discard: #(String, String)

discard value of white-space-collapse

pub const inherit: #(String, String)
pub const initial: #(String, String)
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: #(String, String)
pub const revert_layer: #(String, String)
pub const unset: #(String, String)
pub fn var(variable: String) -> #(String, String)

Enter a variable name to be used for white-space-collapse. It will be wrapped in var() and have -- prepended.

Search Document