pub struct Css { /* private fields */ }Expand description
A type-safe CSS style declaration block.
Build a style by chaining builder methods; every method returns
Self so further calls can be appended fluently. The resulting
CSS text is produced by ToCss::to_css_string or via
Display.
use whisker_css::ext::*;
use whisker_css::{Color, Display, FlexDirection, Css};
let s = Css::new()
.display(Display::Flex)
.flex_direction(FlexDirection::Column)
.padding(px(12))
.background_color(Color::hex(0x1A1A2E));Implementations§
Source§impl Css
impl Css
Sourcepub fn raw(self, name: &'static str, value: impl Into<String>) -> Self
pub fn raw(self, name: &'static str, value: impl Into<String>) -> Self
Escape hatch — append a raw CSS declaration without type-checking. Use this when Lynx supports a property Whisker has not yet wrapped, or when copying a value verbatim from hand-written CSS.
name should be a &'static str because property names are
part of the CSS grammar, not runtime data. The value is taken
verbatim and not validated.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of declarations currently in the style. Repeats of the same property are counted separately; they collapse during serialization.
Sourcepub fn entries(&self) -> impl Iterator<Item = &CssProp>
pub fn entries(&self) -> impl Iterator<Item = &CssProp>
Iterate over every entry in insertion order, including
duplicates of the same property. Use Self::resolved for
last-write-wins iteration.
Source§impl Css
impl Css
Sourcepub fn animation_name(self, name: impl Into<String>) -> Self
pub fn animation_name(self, name: impl Into<String>) -> Self
Sets animation-name — references a @keyframes block.
https://lynxjs.org/api/css/properties/animation-name
Sourcepub fn animation_duration(self, v: Time) -> Self
pub fn animation_duration(self, v: Time) -> Self
Sets animation-duration.
https://lynxjs.org/api/css/properties/animation-duration
Sourcepub fn animation_timing_function(self, v: EasingFunction) -> Self
pub fn animation_timing_function(self, v: EasingFunction) -> Self
Sets animation-timing-function.
https://lynxjs.org/api/css/properties/animation-timing-function
Sourcepub fn animation_delay(self, v: Time) -> Self
pub fn animation_delay(self, v: Time) -> Self
Sets animation-delay.
https://lynxjs.org/api/css/properties/animation-delay
Sourcepub fn animation_iteration_count(self, v: AnimationIterationCount) -> Self
pub fn animation_iteration_count(self, v: AnimationIterationCount) -> Self
Sets animation-iteration-count.
https://lynxjs.org/api/css/properties/animation-iteration-count
Sourcepub fn animation_direction(self, v: AnimationDirection) -> Self
pub fn animation_direction(self, v: AnimationDirection) -> Self
Sets animation-direction.
https://lynxjs.org/api/css/properties/animation-direction
Sourcepub fn animation_fill_mode(self, v: AnimationFillMode) -> Self
pub fn animation_fill_mode(self, v: AnimationFillMode) -> Self
Sets animation-fill-mode.
https://lynxjs.org/api/css/properties/animation-fill-mode
Sourcepub fn animation_play_state(self, v: AnimationPlayState) -> Self
pub fn animation_play_state(self, v: AnimationPlayState) -> Self
Sets animation-play-state.
https://lynxjs.org/api/css/properties/animation-play-state
Source§impl Css
impl Css
Sourcepub fn background_color(self, v: Color) -> Self
pub fn background_color(self, v: Color) -> Self
Sets background-color. Lynx default: transparent.
https://lynxjs.org/api/css/properties/background-color
Sourcepub fn background_image(self, v: impl Into<ImageRef>) -> Self
pub fn background_image(self, v: impl Into<ImageRef>) -> Self
Sets background-image. Accepts url(...) and <gradient>.
none clears any existing image.
https://lynxjs.org/api/css/properties/background-image
Sourcepub fn background_repeat(self, v: BackgroundRepeat) -> Self
pub fn background_repeat(self, v: BackgroundRepeat) -> Self
Sets background-repeat.
https://lynxjs.org/api/css/properties/background-repeat
Sourcepub fn background_position(self, v: Position) -> Self
pub fn background_position(self, v: Position) -> Self
Sets background-position.
https://lynxjs.org/api/css/properties/background-position
Sourcepub fn background_position_x(self, v: impl Into<LengthPercentage>) -> Self
pub fn background_position_x(self, v: impl Into<LengthPercentage>) -> Self
Sets background-position-x — horizontal component only.
https://lynxjs.org/api/css/properties/background-position-x
Sourcepub fn background_position_y(self, v: impl Into<LengthPercentage>) -> Self
pub fn background_position_y(self, v: impl Into<LengthPercentage>) -> Self
Sets background-position-y — vertical component only.
https://lynxjs.org/api/css/properties/background-position-y
Sourcepub fn background_size(self, v: BackgroundSize) -> Self
pub fn background_size(self, v: BackgroundSize) -> Self
Sets background-size.
https://lynxjs.org/api/css/properties/background-size
Sourcepub fn background_origin(self, v: BackgroundOrigin) -> Self
pub fn background_origin(self, v: BackgroundOrigin) -> Self
Sets background-origin. Lynx default: padding-box.
https://lynxjs.org/api/css/properties/background-origin
Sourcepub fn background_clip(self, v: BackgroundClip) -> Self
pub fn background_clip(self, v: BackgroundClip) -> Self
Sets background-clip. Lynx default: border-box.
https://lynxjs.org/api/css/properties/background-clip
Sourcepub fn background_attachment(self, v: BackgroundAttachment) -> Self
pub fn background_attachment(self, v: BackgroundAttachment) -> Self
Sets background-attachment. Lynx default: scroll.
https://lynxjs.org/api/css/properties/background-attachment
Sourcepub fn color(self, v: Color) -> Self
pub fn color(self, v: Color) -> Self
Sets color — the foreground color used by text and SVG strokes.
https://lynxjs.org/api/css/properties/color
Source§impl Css
impl Css
Sourcepub fn border_top_width(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_top_width(self, v: impl Into<LengthPercentage>) -> Self
Sets border-top-width.
https://lynxjs.org/api/css/properties/border-top-width
Sourcepub fn border_right_width(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_right_width(self, v: impl Into<LengthPercentage>) -> Self
Sets border-right-width.
https://lynxjs.org/api/css/properties/border-right-width
Sourcepub fn border_bottom_width(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_bottom_width(self, v: impl Into<LengthPercentage>) -> Self
Sets border-bottom-width.
https://lynxjs.org/api/css/properties/border-bottom-width
Sourcepub fn border_left_width(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_left_width(self, v: impl Into<LengthPercentage>) -> Self
Sets border-left-width.
https://lynxjs.org/api/css/properties/border-left-width
Sourcepub fn border_top_style(self, v: BorderStyle) -> Self
pub fn border_top_style(self, v: BorderStyle) -> Self
Sets border-top-style.
https://lynxjs.org/api/css/properties/border-top-style
Sourcepub fn border_right_style(self, v: BorderStyle) -> Self
pub fn border_right_style(self, v: BorderStyle) -> Self
Sets border-right-style.
https://lynxjs.org/api/css/properties/border-right-style
Sourcepub fn border_bottom_style(self, v: BorderStyle) -> Self
pub fn border_bottom_style(self, v: BorderStyle) -> Self
Sets border-bottom-style.
https://lynxjs.org/api/css/properties/border-bottom-style
Sourcepub fn border_left_style(self, v: BorderStyle) -> Self
pub fn border_left_style(self, v: BorderStyle) -> Self
Sets border-left-style.
https://lynxjs.org/api/css/properties/border-left-style
Sourcepub fn border_top_color(self, v: Color) -> Self
pub fn border_top_color(self, v: Color) -> Self
Sets border-top-color.
https://lynxjs.org/api/css/properties/border-top-color
Sourcepub fn border_right_color(self, v: Color) -> Self
pub fn border_right_color(self, v: Color) -> Self
Sets border-right-color.
https://lynxjs.org/api/css/properties/border-right-color
Sourcepub fn border_bottom_color(self, v: Color) -> Self
pub fn border_bottom_color(self, v: Color) -> Self
Sets border-bottom-color.
https://lynxjs.org/api/css/properties/border-bottom-color
Sourcepub fn border_left_color(self, v: Color) -> Self
pub fn border_left_color(self, v: Color) -> Self
Sets border-left-color.
https://lynxjs.org/api/css/properties/border-left-color
Sourcepub fn border_top_left_radius(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_top_left_radius(self, v: impl Into<LengthPercentage>) -> Self
Sets border-top-left-radius.
https://lynxjs.org/api/css/properties/border-top-left-radius
Sourcepub fn border_top_right_radius(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_top_right_radius(self, v: impl Into<LengthPercentage>) -> Self
Sets border-top-right-radius.
https://lynxjs.org/api/css/properties/border-top-right-radius
Sourcepub fn border_bottom_right_radius(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_bottom_right_radius(self, v: impl Into<LengthPercentage>) -> Self
Sets border-bottom-right-radius.
https://lynxjs.org/api/css/properties/border-bottom-right-radius
Sourcepub fn border_bottom_left_radius(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_bottom_left_radius(self, v: impl Into<LengthPercentage>) -> Self
Sets border-bottom-left-radius.
https://lynxjs.org/api/css/properties/border-bottom-left-radius
Sourcepub fn border_radius(self, v: impl Into<LengthPercentage>) -> Self
pub fn border_radius(self, v: impl Into<LengthPercentage>) -> Self
Sets border-radius shorthand. Expands to the four corner
longhand properties so subsequent per-corner overrides win.
https://lynxjs.org/api/css/properties/border-radius
Sourcepub fn border_radius_full(self, v: BorderRadius) -> Self
pub fn border_radius_full(self, v: BorderRadius) -> Self
Sets border-radius to a BorderRadius
with per-corner control and optional elliptical second axis.
Pushed as the shorthand because Lynx serializes elliptical
corners via the / separator that has no longhand form.
https://lynxjs.org/api/css/properties/border-radius
Source§impl Css
impl Css
Sourcepub fn width(self, v: impl Into<Size>) -> Self
pub fn width(self, v: impl Into<Size>) -> Self
Sets width. Lynx default: auto.
https://lynxjs.org/api/css/properties/width
Sourcepub fn height(self, v: impl Into<Size>) -> Self
pub fn height(self, v: impl Into<Size>) -> Self
Sets height. Lynx default: auto.
https://lynxjs.org/api/css/properties/height
Sourcepub fn min_width(self, v: impl Into<Size>) -> Self
pub fn min_width(self, v: impl Into<Size>) -> Self
Sets min-width. Lynx default: 0.
https://lynxjs.org/api/css/properties/min-width
Sourcepub fn min_height(self, v: impl Into<Size>) -> Self
pub fn min_height(self, v: impl Into<Size>) -> Self
Sets min-height. Lynx default: 0.
https://lynxjs.org/api/css/properties/min-height
Sourcepub fn max_width(self, v: impl Into<Size>) -> Self
pub fn max_width(self, v: impl Into<Size>) -> Self
Sets max-width. Lynx default: none.
https://lynxjs.org/api/css/properties/max-width
Sourcepub fn max_height(self, v: impl Into<Size>) -> Self
pub fn max_height(self, v: impl Into<Size>) -> Self
Sets max-height. Lynx default: none.
https://lynxjs.org/api/css/properties/max-height
Sourcepub fn box_sizing(self, v: BoxSizing) -> Self
pub fn box_sizing(self, v: BoxSizing) -> Self
Sets box-sizing. Lynx default: border-box.
https://lynxjs.org/api/css/properties/box-sizing
Sourcepub fn aspect_ratio(self, width: f32, height: f32) -> Self
pub fn aspect_ratio(self, width: f32, height: f32) -> Self
Sets aspect-ratio to <width> / <height>.
https://lynxjs.org/api/css/properties/aspect-ratio
Sourcepub fn padding_top(self, v: impl Into<LengthPercentage>) -> Self
pub fn padding_top(self, v: impl Into<LengthPercentage>) -> Self
Sets padding-top. Negative values are clamped to zero by Lynx.
https://lynxjs.org/api/css/properties/padding-top
Sourcepub fn padding_right(self, v: impl Into<LengthPercentage>) -> Self
pub fn padding_right(self, v: impl Into<LengthPercentage>) -> Self
Sets padding-right. Negative values are clamped to zero by Lynx.
https://lynxjs.org/api/css/properties/padding-right
Sourcepub fn padding_bottom(self, v: impl Into<LengthPercentage>) -> Self
pub fn padding_bottom(self, v: impl Into<LengthPercentage>) -> Self
Sets padding-bottom. Negative values are clamped to zero by Lynx.
https://lynxjs.org/api/css/properties/padding-bottom
Sourcepub fn padding_left(self, v: impl Into<LengthPercentage>) -> Self
pub fn padding_left(self, v: impl Into<LengthPercentage>) -> Self
Sets padding-left. Negative values are clamped to zero by Lynx.
https://lynxjs.org/api/css/properties/padding-left
Sourcepub fn margin_top(self, v: impl Into<MarginValue>) -> Self
pub fn margin_top(self, v: impl Into<MarginValue>) -> Self
Sets margin-top. Lynx allows negative values and auto.
https://lynxjs.org/api/css/properties/margin-top
Sourcepub fn margin_right(self, v: impl Into<MarginValue>) -> Self
pub fn margin_right(self, v: impl Into<MarginValue>) -> Self
Sets margin-right. Lynx allows negative values and auto.
https://lynxjs.org/api/css/properties/margin-right
Sourcepub fn margin_bottom(self, v: impl Into<MarginValue>) -> Self
pub fn margin_bottom(self, v: impl Into<MarginValue>) -> Self
Sets margin-bottom. Lynx allows negative values and auto.
https://lynxjs.org/api/css/properties/margin-bottom
Sourcepub fn margin_left(self, v: impl Into<MarginValue>) -> Self
pub fn margin_left(self, v: impl Into<MarginValue>) -> Self
Sets margin-left. Lynx allows negative values and auto.
https://lynxjs.org/api/css/properties/margin-left
Sourcepub fn gap(self, v: impl Into<LengthPercentage>) -> Self
pub fn gap(self, v: impl Into<LengthPercentage>) -> Self
Sets gap — shorthand for row-gap and column-gap.
https://lynxjs.org/api/css/properties/gap
Sourcepub fn row_gap(self, v: impl Into<LengthPercentage>) -> Self
pub fn row_gap(self, v: impl Into<LengthPercentage>) -> Self
Sets row-gap — inline gap between rows in flex/grid layouts.
https://lynxjs.org/api/css/properties/row-gap
Sourcepub fn column_gap(self, v: impl Into<LengthPercentage>) -> Self
pub fn column_gap(self, v: impl Into<LengthPercentage>) -> Self
Sets column-gap — gap between columns in flex/grid layouts.
https://lynxjs.org/api/css/properties/column-gap
Source§impl Css
impl Css
Sourcepub fn display(self, v: Display) -> Self
pub fn display(self, v: Display) -> Self
Sets display. Lynx default: linear.
https://lynxjs.org/api/css/properties/display
Sourcepub fn display_none(self) -> Self
pub fn display_none(self) -> Self
Sets display: none — element is removed from the layout tree.
Sourcepub fn display_flex(self) -> Self
pub fn display_flex(self) -> Self
Sets display: flex — opt into CSS flexbox.
Sourcepub fn display_grid(self) -> Self
pub fn display_grid(self) -> Self
Sets display: grid — opt into CSS grid.
Sourcepub fn display_linear(self) -> Self
pub fn display_linear(self) -> Self
Sets display: linear — Lynx default linear layout.
Sourcepub fn display_relative(self) -> Self
pub fn display_relative(self) -> Self
Sets display: relative — Lynx relative-positioning container.
Sourcepub fn direction(self, v: Direction) -> Self
pub fn direction(self, v: Direction) -> Self
Sets direction. Lynx default: ltr.
https://lynxjs.org/api/css/properties/direction
Source§impl Css
impl Css
Sourcepub fn opacity(self, v: f32) -> Self
pub fn opacity(self, v: f32) -> Self
Sets opacity. Lynx clamps to 0.0..=1.0. Default: 1.
https://lynxjs.org/api/css/properties/opacity
Sourcepub fn visibility(self, v: Visibility) -> Self
pub fn visibility(self, v: Visibility) -> Self
Sets visibility. Lynx default: visible. collapse is not
supported.
https://lynxjs.org/api/css/properties/visibility
Sourcepub fn overflow(self, v: Overflow) -> Self
pub fn overflow(self, v: Overflow) -> Self
Sets overflow. Lynx accepts only visible and hidden.
https://lynxjs.org/api/css/properties/overflow
Sourcepub fn overflow_x(self, v: Overflow) -> Self
pub fn overflow_x(self, v: Overflow) -> Self
Sets overflow-x.
https://lynxjs.org/api/css/properties/overflow-x
Sourcepub fn overflow_y(self, v: Overflow) -> Self
pub fn overflow_y(self, v: Overflow) -> Self
Sets overflow-y.
https://lynxjs.org/api/css/properties/overflow-y
Sourcepub fn cursor(self, v: Cursor) -> Self
pub fn cursor(self, v: Cursor) -> Self
Sets cursor.
https://lynxjs.org/api/css/properties/cursor
Sourcepub fn pointer_events(self, v: PointerEvents) -> Self
pub fn pointer_events(self, v: PointerEvents) -> Self
Sets pointer-events.
https://lynxjs.org/api/css/properties/pointer-events
Sourcepub fn box_shadow(
self,
offset_x: Length,
offset_y: Length,
blur_radius: Length,
spread_radius: Length,
color: Color,
) -> Self
pub fn box_shadow( self, offset_x: Length, offset_y: Length, blur_radius: Length, spread_radius: Length, color: Color, ) -> Self
Sets box-shadow to a single shadow. Pass None for inset
to get an outer shadow.
https://lynxjs.org/api/css/properties/box-shadow
Sourcepub fn box_shadow_inset(
self,
offset_x: Length,
offset_y: Length,
blur_radius: Length,
spread_radius: Length,
color: Color,
) -> Self
pub fn box_shadow_inset( self, offset_x: Length, offset_y: Length, blur_radius: Length, spread_radius: Length, color: Color, ) -> Self
Sets an inset box-shadow.
https://lynxjs.org/api/css/properties/box-shadow
Sourcepub fn filter(self, value: impl Into<String>) -> Self
pub fn filter(self, value: impl Into<String>) -> Self
Sets filter to a raw CSS filter list. Use raw because the
<filter-function> grammar (blur, drop-shadow, etc.) is rich
and rarely worth typing.
https://lynxjs.org/api/css/properties/filter
Sourcepub fn mask_image(self, value: impl Into<String>) -> Self
pub fn mask_image(self, value: impl Into<String>) -> Self
Sets mask-image to a raw CSS value (URL or gradient).
https://lynxjs.org/api/css/properties/mask-image
Sourcepub fn clip_path(self, value: impl Into<String>) -> Self
pub fn clip_path(self, value: impl Into<String>) -> Self
Sets clip-path to a raw CSS value.
https://lynxjs.org/api/css/properties/clip-path
Sourcepub fn caret_color(self, v: Color) -> Self
pub fn caret_color(self, v: Color) -> Self
Sets caret-color.
https://lynxjs.org/api/css/properties/caret-color
Sourcepub fn outline_width(self, v: Length) -> Self
pub fn outline_width(self, v: Length) -> Self
Sets outline-width.
https://lynxjs.org/api/css/properties/outline-width
Sourcepub fn outline_color(self, v: Color) -> Self
pub fn outline_color(self, v: Color) -> Self
Sets outline-color.
https://lynxjs.org/api/css/properties/outline-color
Sourcepub fn outline_style(self, v: BorderStyle) -> Self
pub fn outline_style(self, v: BorderStyle) -> Self
Sets outline-style.
https://lynxjs.org/api/css/properties/outline-style
Sourcepub fn outline_offset(self, v: Length) -> Self
pub fn outline_offset(self, v: Length) -> Self
Sets outline-offset.
https://lynxjs.org/api/css/properties/outline-offset
Sourcepub fn caret_width(self, v: Length) -> Self
pub fn caret_width(self, v: Length) -> Self
Sets caret-width. Lynx accepts a length controlling the
rendered caret thickness.
Sourcepub fn x_handle_color(self, v: Color) -> Self
pub fn x_handle_color(self, v: Color) -> Self
Sets -x-handle-color — Lynx-only selection-handle color.
https://lynxjs.org/api/css/properties/-x-handle-color
Sourcepub fn x_handle_size(self, v: impl Into<LengthPercentage>) -> Self
pub fn x_handle_size(self, v: impl Into<LengthPercentage>) -> Self
Sets -x-handle-size — Lynx-only selection-handle size.
https://lynxjs.org/api/css/properties/-x-handle-size
Sourcepub fn x_auto_font_size(self, enabled: bool) -> Self
pub fn x_auto_font_size(self, enabled: bool) -> Self
Sets -x-auto-font-size — Lynx-only auto font-size flag.
https://lynxjs.org/api/css/properties/-x-auto-font-size
Sourcepub fn x_auto_font_size_preset_sizes(
self,
sizes: impl IntoIterator<Item = Length>,
) -> Self
pub fn x_auto_font_size_preset_sizes( self, sizes: impl IntoIterator<Item = Length>, ) -> Self
Sets -x-auto-font-size-preset-sizes — Lynx-only list of preset sizes.
https://lynxjs.org/api/css/properties/-x-auto-font-size-preset-sizes
Source§impl Css
impl Css
Sourcepub fn flex_direction(self, v: FlexDirection) -> Self
pub fn flex_direction(self, v: FlexDirection) -> Self
Sets flex-direction. Lynx default: row.
https://lynxjs.org/api/css/properties/flex-direction
Sourcepub fn flex_wrap(self, v: FlexWrap) -> Self
pub fn flex_wrap(self, v: FlexWrap) -> Self
Sets flex-wrap. Lynx default: nowrap.
https://lynxjs.org/api/css/properties/flex-wrap
Sourcepub fn flex_grow(self, v: f32) -> Self
pub fn flex_grow(self, v: f32) -> Self
Sets flex-grow. Lynx default: 0. Negative values are
clamped to zero.
https://lynxjs.org/api/css/properties/flex-grow
Sourcepub fn flex_shrink(self, v: f32) -> Self
pub fn flex_shrink(self, v: f32) -> Self
Sets flex-shrink. Lynx default: 1. Negative values are
clamped to zero.
https://lynxjs.org/api/css/properties/flex-shrink
Sourcepub fn flex_basis(self, v: impl Into<FlexBasis>) -> Self
pub fn flex_basis(self, v: impl Into<FlexBasis>) -> Self
Sets flex-basis. Lynx default: auto.
https://lynxjs.org/api/css/properties/flex-basis
Sourcepub fn justify_content(self, v: JustifyContent) -> Self
pub fn justify_content(self, v: JustifyContent) -> Self
Sets justify-content — main-axis distribution.
https://lynxjs.org/api/css/properties/justify-content
Sourcepub fn align_items(self, v: AlignItems) -> Self
pub fn align_items(self, v: AlignItems) -> Self
Sets align-items — cross-axis alignment for all items.
https://lynxjs.org/api/css/properties/align-items
Sourcepub fn align_self(self, v: AlignSelf) -> Self
pub fn align_self(self, v: AlignSelf) -> Self
Sets align-self — cross-axis alignment for this item only.
https://lynxjs.org/api/css/properties/align-self
Sourcepub fn align_content(self, v: AlignContent) -> Self
pub fn align_content(self, v: AlignContent) -> Self
Sets align-content — cross-axis distribution of wrapped lines.
https://lynxjs.org/api/css/properties/align-content
Sourcepub fn order(self, v: i32) -> Self
pub fn order(self, v: i32) -> Self
Sets order — controls layout order among flex/grid siblings.
https://lynxjs.org/api/css/properties/order
Source§impl Css
impl Css
Sourcepub fn grid_template_rows(self, v: GridTemplate) -> Self
pub fn grid_template_rows(self, v: GridTemplate) -> Self
Sets grid-template-rows — track-sizing along the block axis.
https://lynxjs.org/api/css/properties/grid-template-rows
Sourcepub fn grid_template_columns(self, v: GridTemplate) -> Self
pub fn grid_template_columns(self, v: GridTemplate) -> Self
Sets grid-template-columns — track-sizing along the inline axis.
https://lynxjs.org/api/css/properties/grid-template-columns
Sourcepub fn grid_auto_rows(self, v: GridTemplate) -> Self
pub fn grid_auto_rows(self, v: GridTemplate) -> Self
Sets grid-auto-rows.
https://lynxjs.org/api/css/properties/grid-auto-rows
Sourcepub fn grid_auto_columns(self, v: GridTemplate) -> Self
pub fn grid_auto_columns(self, v: GridTemplate) -> Self
Sets grid-auto-columns.
https://lynxjs.org/api/css/properties/grid-auto-columns
Sourcepub fn grid_auto_flow(self, v: GridAutoFlow) -> Self
pub fn grid_auto_flow(self, v: GridAutoFlow) -> Self
Sets grid-auto-flow.
https://lynxjs.org/api/css/properties/grid-auto-flow
Sourcepub fn grid_row_start(self, v: GridLine) -> Self
pub fn grid_row_start(self, v: GridLine) -> Self
Sets grid-row-start.
https://lynxjs.org/api/css/properties/grid-row-start
Sourcepub fn grid_row_end(self, v: GridLine) -> Self
pub fn grid_row_end(self, v: GridLine) -> Self
Sets grid-row-end.
https://lynxjs.org/api/css/properties/grid-row-end
Sourcepub fn grid_column_start(self, v: GridLine) -> Self
pub fn grid_column_start(self, v: GridLine) -> Self
Sets grid-column-start.
https://lynxjs.org/api/css/properties/grid-column-start
Sourcepub fn grid_column_end(self, v: GridLine) -> Self
pub fn grid_column_end(self, v: GridLine) -> Self
Sets grid-column-end.
https://lynxjs.org/api/css/properties/grid-column-end
Sourcepub fn grid_row_gap(self, v: impl Into<LengthPercentage>) -> Self
pub fn grid_row_gap(self, v: impl Into<LengthPercentage>) -> Self
Sets grid-row-gap (legacy alias for row-gap).
https://lynxjs.org/api/css/properties/grid-row-gap
Sourcepub fn grid_column_gap(self, v: impl Into<LengthPercentage>) -> Self
pub fn grid_column_gap(self, v: impl Into<LengthPercentage>) -> Self
Sets grid-column-gap (legacy alias for column-gap).
https://lynxjs.org/api/css/properties/grid-column-gap
Source§impl Css
impl Css
Sourcepub fn linear_orientation(self, v: LinearOrientation) -> Self
pub fn linear_orientation(self, v: LinearOrientation) -> Self
Sets linear-orientation — Lynx’s analogue of flex-direction.
https://lynxjs.org/api/css/properties/linear-orientation
Sourcepub fn linear_direction(self, v: LinearOrientation) -> Self
pub fn linear_direction(self, v: LinearOrientation) -> Self
Sets linear-direction — direction the linear container flows.
https://lynxjs.org/api/css/properties/linear-direction
Sourcepub fn linear_gravity(self, v: LinearGravity) -> Self
pub fn linear_gravity(self, v: LinearGravity) -> Self
Sets linear-gravity — main-axis alignment. Deprecated;
switch to display: flex + justify-content when possible.
https://lynxjs.org/api/css/properties/linear-gravity
Sourcepub fn linear_cross_gravity(self, v: LinearCrossGravity) -> Self
pub fn linear_cross_gravity(self, v: LinearCrossGravity) -> Self
Sets linear-cross-gravity — cross-axis alignment for all items.
https://lynxjs.org/api/css/properties/linear-cross-gravity
Sourcepub fn linear_layout_gravity(self, v: LinearLayoutGravity) -> Self
pub fn linear_layout_gravity(self, v: LinearLayoutGravity) -> Self
Sets linear-layout-gravity — per-item cross-axis override.
https://lynxjs.org/api/css/properties/linear-layout-gravity
Sourcepub fn linear_weight(self, v: f32) -> Self
pub fn linear_weight(self, v: f32) -> Self
Sets linear-weight — relative size weight along the main axis.
https://lynxjs.org/api/css/properties/linear-weight
Sourcepub fn linear_weight_sum(self, v: f32) -> Self
pub fn linear_weight_sum(self, v: f32) -> Self
Sets linear-weight-sum — denominator for weight calculations.
https://lynxjs.org/api/css/properties/linear-weight-sum
Source§impl Css
impl Css
Sourcepub fn position(self, v: PositionKind) -> Self
pub fn position(self, v: PositionKind) -> Self
Sets position. Lynx default: relative.
static is not supported by Lynx.
https://lynxjs.org/api/css/properties/position
Sourcepub fn top(self, v: impl Into<LengthPercentage>) -> Self
pub fn top(self, v: impl Into<LengthPercentage>) -> Self
Sets top offset (positioned elements).
https://lynxjs.org/api/css/properties/top
Sourcepub fn right(self, v: impl Into<LengthPercentage>) -> Self
pub fn right(self, v: impl Into<LengthPercentage>) -> Self
Sets right offset (positioned elements).
https://lynxjs.org/api/css/properties/right
Sourcepub fn bottom(self, v: impl Into<LengthPercentage>) -> Self
pub fn bottom(self, v: impl Into<LengthPercentage>) -> Self
Sets bottom offset (positioned elements).
https://lynxjs.org/api/css/properties/bottom
Sourcepub fn left(self, v: impl Into<LengthPercentage>) -> Self
pub fn left(self, v: impl Into<LengthPercentage>) -> Self
Sets left offset (positioned elements).
https://lynxjs.org/api/css/properties/left
Sourcepub fn inset_inline_start(self, v: impl Into<LengthPercentage>) -> Self
pub fn inset_inline_start(self, v: impl Into<LengthPercentage>) -> Self
Sets inset-inline-start — logical start edge.
https://lynxjs.org/api/css/properties/inset-inline-start
Sourcepub fn inset_inline_end(self, v: impl Into<LengthPercentage>) -> Self
pub fn inset_inline_end(self, v: impl Into<LengthPercentage>) -> Self
Sets inset-inline-end — logical end edge.
https://lynxjs.org/api/css/properties/inset-inline-end
Sourcepub fn z_index(self, v: i32) -> Self
pub fn z_index(self, v: i32) -> Self
Sets z-index. Lynx default: auto (no stacking context promotion).
https://lynxjs.org/api/css/properties/z-index
Source§impl Css
impl Css
Sourcepub fn relative_id(self, v: i32) -> Self
pub fn relative_id(self, v: i32) -> Self
Sets relative-id — identifies the element for sibling-edge
references.
https://lynxjs.org/api/css/properties/relative-id
Sourcepub fn relative_align_top(self, v: i32) -> Self
pub fn relative_align_top(self, v: i32) -> Self
Sets relative-align-top — id of the sibling to top-align with.
https://lynxjs.org/api/css/properties/relative-align-top
Sourcepub fn relative_align_right(self, v: i32) -> Self
pub fn relative_align_right(self, v: i32) -> Self
Sets relative-align-right — id of the sibling to right-align with.
https://lynxjs.org/api/css/properties/relative-align-right
Sourcepub fn relative_align_bottom(self, v: i32) -> Self
pub fn relative_align_bottom(self, v: i32) -> Self
Sets relative-align-bottom.
https://lynxjs.org/api/css/properties/relative-align-bottom
Sourcepub fn relative_align_left(self, v: i32) -> Self
pub fn relative_align_left(self, v: i32) -> Self
Sets relative-align-left.
https://lynxjs.org/api/css/properties/relative-align-left
Sourcepub fn relative_top_of(self, v: i32) -> Self
pub fn relative_top_of(self, v: i32) -> Self
Sets relative-top-of — id of the sibling this element sits below.
https://lynxjs.org/api/css/properties/relative-top-of
Sourcepub fn relative_right_of(self, v: i32) -> Self
pub fn relative_right_of(self, v: i32) -> Self
Sets relative-right-of — id of the sibling this element sits to the right of.
https://lynxjs.org/api/css/properties/relative-right-of
Sourcepub fn relative_bottom_of(self, v: i32) -> Self
pub fn relative_bottom_of(self, v: i32) -> Self
Sets relative-bottom-of.
https://lynxjs.org/api/css/properties/relative-bottom-of
Sourcepub fn relative_left_of(self, v: i32) -> Self
pub fn relative_left_of(self, v: i32) -> Self
Sets relative-left-of.
https://lynxjs.org/api/css/properties/relative-left-of
Sourcepub fn relative_center(self, v: i32) -> Self
pub fn relative_center(self, v: i32) -> Self
Sets relative-center — centers the element relative to a sibling.
https://lynxjs.org/api/css/properties/relative-center
Sourcepub fn relative_center_horizontal(self, v: i32) -> Self
pub fn relative_center_horizontal(self, v: i32) -> Self
Sets relative-center-horizontal — centers horizontally only.
https://lynxjs.org/api/css/properties/relative-center-horizontal
Sourcepub fn relative_center_vertical(self, v: i32) -> Self
pub fn relative_center_vertical(self, v: i32) -> Self
Sets relative-center-vertical — centers vertically only.
https://lynxjs.org/api/css/properties/relative-center-vertical
Sourcepub fn relative_layout_once(self, v: bool) -> Self
pub fn relative_layout_once(self, v: bool) -> Self
Sets relative-layout-once — performs the relative-layout
pass only on the first render.
https://lynxjs.org/api/css/properties/relative-layout-once
Sourcepub fn relative_align_inline_start(self, v: i32) -> Self
pub fn relative_align_inline_start(self, v: i32) -> Self
Sets relative-align-inline-start (logical-direction alias).
Sourcepub fn relative_align_inline_end(self, v: i32) -> Self
pub fn relative_align_inline_end(self, v: i32) -> Self
Sets relative-align-inline-end (logical-direction alias).
Sourcepub fn relative_inline_start_of(self, v: i32) -> Self
pub fn relative_inline_start_of(self, v: i32) -> Self
Sets relative-inline-start-of.
Sourcepub fn relative_inline_end_of(self, v: i32) -> Self
pub fn relative_inline_end_of(self, v: i32) -> Self
Sets relative-inline-end-of.
Source§impl Css
impl Css
Sourcepub fn text_align(self, v: TextAlign) -> Self
pub fn text_align(self, v: TextAlign) -> Self
Sets text-align. justify is not supported by Lynx.
https://lynxjs.org/api/css/properties/text-align
Sourcepub fn text_decoration_line(self, v: TextDecorationLine) -> Self
pub fn text_decoration_line(self, v: TextDecorationLine) -> Self
Sets text-decoration-line (single value).
https://lynxjs.org/api/css/properties/text-decoration-line
Sourcepub fn text_decoration_style(self, v: TextDecorationStyle) -> Self
pub fn text_decoration_style(self, v: TextDecorationStyle) -> Self
Sets text-decoration-style.
https://lynxjs.org/api/css/properties/text-decoration-style
Sourcepub fn text_decoration_color(self, v: Color) -> Self
pub fn text_decoration_color(self, v: Color) -> Self
Sets text-decoration-color.
https://lynxjs.org/api/css/properties/text-decoration-color
Sourcepub fn text_decoration_thickness(self, v: Length) -> Self
pub fn text_decoration_thickness(self, v: Length) -> Self
Sets text-decoration-thickness.
https://lynxjs.org/api/css/properties/text-decoration-thickness
Sourcepub fn text_overflow(self, v: TextOverflow) -> Self
pub fn text_overflow(self, v: TextOverflow) -> Self
Sets text-overflow.
https://lynxjs.org/api/css/properties/text-overflow
Sourcepub fn text_transform(self, v: TextTransform) -> Self
pub fn text_transform(self, v: TextTransform) -> Self
Sets text-transform.
https://lynxjs.org/api/css/properties/text-transform
Sourcepub fn text_indent(self, v: impl Into<LengthPercentage>) -> Self
pub fn text_indent(self, v: impl Into<LengthPercentage>) -> Self
Sets text-indent — first-line indentation.
https://lynxjs.org/api/css/properties/text-indent
Sourcepub fn vertical_align(self, v: VerticalAlign) -> Self
pub fn vertical_align(self, v: VerticalAlign) -> Self
Sets vertical-align.
https://lynxjs.org/api/css/properties/vertical-align
Sourcepub fn white_space(self, v: WhiteSpace) -> Self
pub fn white_space(self, v: WhiteSpace) -> Self
Sets white-space.
https://lynxjs.org/api/css/properties/white-space
Sourcepub fn word_break(self, v: WordBreak) -> Self
pub fn word_break(self, v: WordBreak) -> Self
Sets word-break.
https://lynxjs.org/api/css/properties/word-break
Sourcepub fn word_wrap(self, v: WordWrap) -> Self
pub fn word_wrap(self, v: WordWrap) -> Self
Sets word-wrap (also known as overflow-wrap).
https://lynxjs.org/api/css/properties/word-wrap
Sourcepub fn overflow_wrap(self, v: WordWrap) -> Self
pub fn overflow_wrap(self, v: WordWrap) -> Self
Sets overflow-wrap — synonym of word-wrap.
https://lynxjs.org/api/css/properties/overflow-wrap
Sourcepub fn webkit_line_clamp(self, v: u32) -> Self
pub fn webkit_line_clamp(self, v: u32) -> Self
Sets -webkit-line-clamp — limit the visible line count.
https://lynxjs.org/api/css/properties/-webkit-line-clamp
Sourcepub fn text_stroke_width(self, v: Length) -> Self
pub fn text_stroke_width(self, v: Length) -> Self
Sets text-stroke-width.
https://lynxjs.org/api/css/properties/text-stroke-width
Sourcepub fn text_stroke_color(self, v: Color) -> Self
pub fn text_stroke_color(self, v: Color) -> Self
Sets text-stroke-color.
https://lynxjs.org/api/css/properties/text-stroke-color
Source§impl Css
impl Css
Sourcepub fn transform_origin(self, v: Position) -> Self
pub fn transform_origin(self, v: Position) -> Self
Sets transform-origin.
https://lynxjs.org/api/css/properties/transform-origin
Sourcepub fn transform_box(self, v: TransformBox) -> Self
pub fn transform_box(self, v: TransformBox) -> Self
Sets transform-box.
https://lynxjs.org/api/css/properties/transform-box
Sourcepub fn transform_style(self, v: TransformStyle) -> Self
pub fn transform_style(self, v: TransformStyle) -> Self
Sets transform-style.
https://lynxjs.org/api/css/properties/transform-style
Sourcepub fn backface_visibility(self, v: BackfaceVisibility) -> Self
pub fn backface_visibility(self, v: BackfaceVisibility) -> Self
Sets backface-visibility.
https://lynxjs.org/api/css/properties/backface-visibility
Sourcepub fn perspective(self, v: Length) -> Self
pub fn perspective(self, v: Length) -> Self
Sets perspective — distance from the viewer to the z=0 plane.
https://lynxjs.org/api/css/properties/perspective
Sourcepub fn perspective_origin(self, v: Position) -> Self
pub fn perspective_origin(self, v: Position) -> Self
Sets perspective-origin.
https://lynxjs.org/api/css/properties/perspective-origin
Source§impl Css
impl Css
Sourcepub fn transition_property(self, v: TransitionPropertyKind) -> Self
pub fn transition_property(self, v: TransitionPropertyKind) -> Self
Sets transition-property — the property to transition.
https://lynxjs.org/api/css/properties/transition-property
Sourcepub fn transition_duration(self, v: Time) -> Self
pub fn transition_duration(self, v: Time) -> Self
Sets transition-duration.
https://lynxjs.org/api/css/properties/transition-duration
Sourcepub fn transition_timing_function(self, v: EasingFunction) -> Self
pub fn transition_timing_function(self, v: EasingFunction) -> Self
Sets transition-timing-function.
https://lynxjs.org/api/css/properties/transition-timing-function
Sourcepub fn transition_delay(self, v: Time) -> Self
pub fn transition_delay(self, v: Time) -> Self
Sets transition-delay. Negative delays cause the transition
to begin partway through its progression.
https://lynxjs.org/api/css/properties/transition-delay
Source§impl Css
impl Css
Sourcepub fn font_family(self, v: impl Into<String>) -> Self
pub fn font_family(self, v: impl Into<String>) -> Self
Sets font-family. Pass a single family name; for multiple
families, call this method once per family or use the
Css::raw escape hatch with a comma-separated list.
https://lynxjs.org/api/css/properties/font-family
Sourcepub fn font_size(self, v: impl Into<LengthPercentage>) -> Self
pub fn font_size(self, v: impl Into<LengthPercentage>) -> Self
Sets font-size. Lynx default: 14px.
https://lynxjs.org/api/css/properties/font-size
Sourcepub fn font_style(self, v: FontStyle) -> Self
pub fn font_style(self, v: FontStyle) -> Self
Sets font-style. Lynx default: normal.
https://lynxjs.org/api/css/properties/font-style
Sourcepub fn font_weight(self, v: FontWeight) -> Self
pub fn font_weight(self, v: FontWeight) -> Self
Sets font-weight. Lynx default: normal. bolder/lighter
are not supported.
https://lynxjs.org/api/css/properties/font-weight
Sourcepub fn font_variant(self, v: FontVariant) -> Self
pub fn font_variant(self, v: FontVariant) -> Self
Sets font-variant.
https://lynxjs.org/api/css/properties/font-variant
Sourcepub fn letter_spacing(self, v: Length) -> Self
pub fn letter_spacing(self, v: Length) -> Self
Sets letter-spacing. Accepts <length>.
https://lynxjs.org/api/css/properties/letter-spacing
Sourcepub fn line_height(self, v: impl Into<LineHeight>) -> Self
pub fn line_height(self, v: impl Into<LineHeight>) -> Self
Sets line-height. Lynx default: normal.
https://lynxjs.org/api/css/properties/line-height
Source§impl Css
impl Css
Sourcepub fn animation(self, a: Animation) -> Self
pub fn animation(self, a: Animation) -> Self
Sets the animation shorthand for a single animation.
https://lynxjs.org/api/css/properties/animation
Sourcepub fn animations(self, anims: impl IntoIterator<Item = Animation>) -> Self
pub fn animations(self, anims: impl IntoIterator<Item = Animation>) -> Self
Sets the animation shorthand for multiple comma-separated
animations.
Source§impl Css
impl Css
Sourcepub fn background(self, b: Background) -> Self
pub fn background(self, b: Background) -> Self
Sets the background shorthand.
https://lynxjs.org/api/css/properties/background
Source§impl Css
impl Css
Sourcepub fn border(self, b: Border) -> Self
pub fn border(self, b: Border) -> Self
Sets border for all four sides. Equivalent to setting
border-top, border-right, border-bottom, border-left
individually.
https://lynxjs.org/api/css/properties/border
Sourcepub fn border_top(self, b: Border) -> Self
pub fn border_top(self, b: Border) -> Self
Sets border-top only.
https://lynxjs.org/api/css/properties/border-top
Sourcepub fn border_right(self, b: Border) -> Self
pub fn border_right(self, b: Border) -> Self
Sets border-right only.
https://lynxjs.org/api/css/properties/border-right
Sourcepub fn border_bottom(self, b: Border) -> Self
pub fn border_bottom(self, b: Border) -> Self
Sets border-bottom only.
https://lynxjs.org/api/css/properties/border-bottom
Sourcepub fn border_left(self, b: Border) -> Self
pub fn border_left(self, b: Border) -> Self
Sets border-left only.
https://lynxjs.org/api/css/properties/border-left
Source§impl Css
impl Css
Sourcepub fn flex(self, v: Flex) -> Self
pub fn flex(self, v: Flex) -> Self
Sets flex shorthand — expands to flex-grow, flex-shrink,
flex-basis.
https://lynxjs.org/api/css/properties/flex
Source§impl Css
impl Css
Sourcepub fn padding(self, v: impl Into<Padding>) -> Self
pub fn padding(self, v: impl Into<Padding>) -> Self
Sets padding shorthand. Expands to the four per-side
longhands so later overrides win cleanly. The argument
accepts a single length, a (y, x) tuple, a (t, x, b)
tuple, or a (t, r, b, l) tuple.
https://lynxjs.org/api/css/properties/padding
Sourcepub fn margin(self, v: impl Into<Margin>) -> Self
pub fn margin(self, v: impl Into<Margin>) -> Self
Sets margin shorthand. Same shape rules as
Css::padding, with auto allowed per side.
https://lynxjs.org/api/css/properties/margin
Source§impl Css
impl Css
Sourcepub fn transform(self, t: impl Into<Transform>) -> Self
pub fn transform(self, t: impl Into<Transform>) -> Self
Sets transform to a list of TransformFns. Functions are
applied left-to-right.
https://lynxjs.org/api/css/properties/transform
Source§impl Css
impl Css
Sourcepub fn transition(self, t: Transition) -> Self
pub fn transition(self, t: Transition) -> Self
Sets the transition shorthand for a single transition.
https://lynxjs.org/api/css/properties/transition
Sourcepub fn transitions(self, ts: impl IntoIterator<Item = Transition>) -> Self
pub fn transitions(self, ts: impl IntoIterator<Item = Transition>) -> Self
Sets the transition shorthand for multiple comma-separated
transitions.