Packages

Type safe CSS-in-gleam using generated code

Current section

Files

Jump to
monks_of_style src monks container_name.gleam
Raw

src/monks/container_name.gleam

//// The **container-name** [CSS](/en-US/docs/Web/CSS) property specifies a list of query container names used by the [@container](/en-US/docs/Web/CSS/Reference/At-rules/@container) at-rule in a [container query](/en-US/docs/Web/CSS/Guides/Containment/Container_queries).
//// A container query will apply styles to elements based on the [size](/en-US/docs/Web/CSS/Guides/Containment/Container_size_and_style_queries#container_size_queries) or [scroll-state](/en-US/docs/Web/CSS/Guides/Conditional_rules/Container_scroll-state_queries) of the nearest ancestor with a containment context.
//// When a containment context is given a name, it can be specifically targeted using the {{Cssxref("@container")}} at-rule instead of the nearest ancestor with containment.
////
/// - : Default value. The query container has no name.
pub const none = #("container-name", "none")
pub const initial = #("container-name", "initial")
pub const inherit = #("container-name", "inherit")
pub const unset = #("container-name", "unset")
pub const revert = #("container-name", "revert")
pub const revert_layer = #("container-name", "revert_layer")
/// Enter a raw string value for container-name
pub fn raw(value: String) -> #(String, String) {
#("container-name", value)
}
/// Enter a variable name to be used for container-name.
/// It will be wrapped in `var()` and have `--` prepended.
pub fn var(variable: String) -> #(String, String) {
#("container-name", "var(--" <> variable <> ")")
}