package toffee

  1. Overview
  2. Docs
CSS layout engine for OCaml (Flexbox, Grid, Block)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.1.0.tbz
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9

doc/toffee.style/Style/Text_align/index.html

Module Style.Text_alignSource

CSS text-align property for block layout.

Implements legacy HTML alignment behavior for block-level elements, corresponding to vendor-prefixed text-align values in browsers.

Text alignment affects the horizontal positioning of in-flow block children within their container. It does not affect absolutely positioned elements or non-block layouts.

Sourcetype t =
  1. | Auto
    (*

    No special text alignment behavior. Block children remain left-aligned.

    *)
  2. | Legacy_left
    (*

    Corresponds to -webkit-left or -moz-left in browsers. Equivalent to left alignment.

    *)
  3. | Legacy_right
    (*

    Corresponds to -webkit-right or -moz-right in browsers. Right-aligns block children.

    *)
  4. | Legacy_center
    (*

    Corresponds to -webkit-center or -moz-center in browsers. Centers block children horizontally.

    *)
Sourceval default : t

default is Auto.

Sourceval to_string : t -> string

to_string align is the CSS string representation of align: "auto", "legacy-left", "legacy-right", or "legacy-center".

Sourceval equal : t -> t -> bool

equal a b is true iff a and b are the same alignment.

Sourceval compare : t -> t -> int

compare a b is a total order on alignment values, compatible with equal.

Sourceval pp : Format.formatter -> t -> unit

pp ppf align formats align on ppf using to_string.