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/Overflow/index.html

Module Style.OverflowSource

CSS overflow property.

The overflow property controls how content that overflows a container affects layout. In toffee, overflow primarily impacts the automatic minimum size calculation for Flexbox and CSS Grid items and controls scrollbar space reservation.

Overflow has two key layout effects:

  • The automatic minimum size of Flexbox and Grid items with non-Visible overflow is 0 rather than content-based.
  • Scroll overflow reserves space for a scrollbar, controlled by the scrollbar_width property.

See CSS overflow documentation.

Sourcetype t =
  1. | Visible
    (*

    Content-based automatic minimum size. Overflowing content contributes to parent scroll region.

    *)
  2. | Clip
    (*

    Content-based automatic minimum size. Overflowing content does not contribute to parent scroll region.

    *)
  3. | Hidden
    (*

    Zero automatic minimum size. Overflowing content does not contribute to parent scroll region.

    *)
  4. | Scroll
    (*

    Zero automatic minimum size with scrollbar space reserved. Overflowing content does not contribute to parent scroll region.

    *)
Sourceval default : t

default returns Visible.

Sourceval to_string : t -> string

to_string overflow converts overflow to its string representation.

Sourceval is_container : t -> bool

is_container overflow returns true if overflow contains its contents.

Returns true for Hidden and Scroll, false for Visible and Clip.

Sourceval to_automatic_min_size : t -> Dimension.t

to_automatic_min_size overflow returns the automatic minimum size for overflow.

Returns Dimension.zero for Hidden and Scroll, Dimension.auto for Visible and Clip. This determines the automatic minimum size of Flexbox and CSS Grid items.

Sourceval equal : t -> t -> bool

equal a b tests structural equality.

Sourceval compare : t -> t -> int

compare a b returns a total ordering.

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

pp fmt overflow formats overflow for display.