package toffee

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.2.0.tbz
sha256=ab48bc02082f9c1deea0769a13c2935df529536630745ec3a3d718f59656109b
sha512=c0f3c490e13ca60217d9d59c9bfdf3ada12e1565f04fe2a623e7c94298d519393eabe404e2317726712bf5e7fa860780a07494e77994ac05032e71f535c56910

doc/toffee.geometry/Toffee_geometry/Abstract_axis/index.html

Module Toffee_geometry.Abstract_axisSource

CSS abstract axis types and operations.

The abstract axis system is defined by the CSS Writing Modes specification (<https://www.w3.org/TR/css-writing-modes-3/#abstract-axes>). Abstract axes describe layout directions independent of physical screen orientation, allowing for different writing modes and text directions.

Currently, toffee assumes horizontal writing mode (Inline = Horizontal, Block = Vertical). Future support for vertical writing modes will affect the mapping to absolute axes.

Sourcetype t =
  1. | Inline
    (*

    The inline axis (horizontal in horizontal writing modes)

    *)
  2. | Block
    (*

    The block axis (vertical in horizontal writing modes)

    *)

Abstract axis direction.

Inline represents the axis in the inline dimension (horizontal in horizontal writing modes, vertical in vertical writing modes).

Block represents the axis in the block dimension (vertical in horizontal writing modes, horizontal in vertical writing modes).

Sourceval other : t -> t

other axis returns the perpendicular axis.

If axis is Inline, returns Block. If axis is Block, returns Inline.

Sourceval to_absolute_naive : t -> Absolute_axis.t

to_absolute_naive axis converts to an absolute axis assuming horizontal writing mode.

This conversion assumes Inline maps to Horizontal and Block maps to Vertical. This assumption holds for all current layouts but will change if toffee implements the writing_mode CSS property in the future.

Returns Absolute_axis.Horizontal for Inline and Absolute_axis.Vertical for Block.