sketch/css
Every CSS properties, pseudo-classes & pseudo-elements are defined here.
Types
Functions
pub fn accent_color(value: String) -> Style
The accent-color CSS property sets the accent color for user-interface controls generated by some elements.
Browsers that support accent-color
currently apply it to the following HTML elements:
Each user agent has an accent color, with variations to ensure legibility
and contrast. That accent color is not used by every user-interface control
nor in every state of the control. The accent-color
is only applied to
user-interface controls that use an accent color in the states where it
is applicable.
pub fn active(styles: List(Style)) -> Style
The :active
CSS
pseudo-class
represents an element (such as a button) that is being activated by the user.
When using a mouse, “activation” typically starts when the user presses down
the primary mouse button.
pub fn after(styles: List(Style)) -> Style
In CSS, ::before
creates a pseudo-element
that is the last child of the selected element. It is often used to add
cosmetic content
to an element with the content property. It is inline by default.
pub fn align_content(align: String) -> Style
The CSS align-content
property sets the distribution of space between and
around content items along a flexbox’s
cross axis, or a
grid or
block-level
element’s block axis.
This property has no effect on single line flex containers (i.e. ones with
flex-wrap: nowrap
).
pub fn align_items(align: String) -> Style
The CSS align-items
property sets the align-self
value on all direct
children as a group. In flexbox, it controls the alignment of items on the
cross axis.
In grid layout, it controls the alignment of items on the block
axis within their grid areas.
pub fn align_self(align: String) -> Style
The align-self
CSS property overrides a grid or flex item’s align-items
value. In grid, it aligns the item inside the
grid areas.
In flexbox, it aligns the item on the
cross axis.
The property doesn’t apply to block-level boxes, or to table cells. If a
flexbox item’s cross-axis margin is auto
, then align-self
is ignored.
pub fn all(value: String) -> Style
The all
shorthand CSS property resets all of an element’s properties
except unicode-bidi
,
direction
, and
CSS Custom Properties.
It can set properties to their initial or inherited values, or to the values
specified in another cascade layer or stylesheet origin.
pub fn animation(animation: String) -> Style
The animation
shorthand CSS property applies an animation between styles.
It is a shorthand for
animation-name
,
animation-duration
,
animation-timing-function
,
animation-delay
,
animation-iteration-count
,
animation-direction
,
animation-fill-mode
,
animation-play-state
,
and animation-timeline
.
This property is a shorthand for the following CSS properties:
animation-delay
animation-direction
animation-duration
animation-fill-mode
animation-iteration-count
animation-name
animation-play-state
animation-timeline
animation-timing-function
pub fn animation_composition(animation: String) -> Style
The animation-composition
CSS property specifies the
composite operation
to use when multiple animations affect the same property simultaneously.
pub fn animation_delay(animation: String) -> Style
The animation-delay
CSS property specifies the amount of time to wait from
applying the animation to an element before beginning to perform the
animation. The animation can start later, immediately from its beginning, or
immediately and partway through the animation.
pub fn animation_direction(animation: String) -> Style
The animation-direction
CSS property sets whether an animation should play
forward, backward, or alternate back and forth between playing the sequence
forward and backward.
pub fn animation_duration(animation: String) -> Style
The animation-duration
CSS property sets the length of time that an
animation takes to complete one cycle.
pub fn animation_fill_mode(animation: String) -> Style
The animation-fill-mode
CSS property sets how a CSS animation applies
styles to its target before and after its execution.
pub fn animation_iteration_count(animation: String) -> Style
The animation-iteration-count
CSS property sets the number of times an
animation sequence should be played before stopping.
pub fn animation_name(animation: String) -> Style
The animation-name
CSS property specifies the names of one or more
@keyframes
at-rules that describe the animation to apply to an element. Multiple
@keyframe
at-rules are specified as a comma-separated list of names. If
the specified name does not match any @keyframe
at-rule, no properties are
animated.
pub fn animation_play_state(animation: String) -> Style
pub fn animation_timing_function(animation: String) -> Style
The animation-timing-function
CSS property sets how an animation progresses
through the duration of each cycle.
pub fn any_link(styles: List(Style)) -> Style
The :any-link
CSS
pseudo-class
selector represents an element that acts as the source anchor of a hyperlink,
independent of whether it has been visited. In other words, it matches every
<a>
or
<area>
element that has an href
attribute. Thus, it matches all
elements that match :link
or :visited
.
pub fn appearance(appearance: String) -> Style
The appearance
CSS property is used to display UI elements with
platform-specific styling, based on the operating system’s theme.
Before standardization, this property allowed elements to be shown as widgets, such as buttons or check boxes. It was considered a misfeature and authors are encouraged to use only standard keywords now.
pub fn aspect_ratio(aspect_ratio: String) -> Style
The aspect-ratio
CSS property allows you to define the desired
width-to-height ratio of an element’s box. This means that even if the
parent container or viewport size changes, the browser will adjust the
element’s dimensions to maintain the specified width-to-height ratio. The
specified aspect ratio
is used in the calculation of auto sizes and some other layout functions.
At least one of the box’s sizes needs to be automatic in order for
aspect-ratio
to have any effect. If neither the width nor height is an
automatic size, then the provided aspect ratio has no effect on the box’s
preferred sizes.
pub fn autofill(styles: List(Style)) -> Style
The :autofill
CSS
pseudo-class
matches when an <input>
element has its value autofilled by the browser. The class stops matching
if the user edits the field.
pub fn backdrop(styles: List(Style)) -> Style
The ::backdrop
CSS
pseudo-element
is a box the size of the viewport,
which is rendered immediately beneath any element being presented in the
top layer.
pub fn backdrop_filter(value: String) -> Style
The backdrop-filter
CSS property lets you apply graphical effects such as
blurring or color shifting to the area behind an element. Because it applies
to everything behind the element, to see the effect the element or its
background needs to be transparent or partially transparent.
pub fn backface_visibility(value: String) -> Style
The backface-visibility
CSS property sets whether the back face of an
element is visible when turned towards the user.
An element’s back face is a mirror image of its front face. Though invisible in 2D, the back face can become visible when a transformation causes the element to be rotated in 3D space. (This property has no effect on 2D transforms, which have no perspective.)
pub fn background(background: String) -> Style
The background
shorthand
CSS property sets all background style properties at once, such as color,
image, origin and size, or repeat method. Component properties not set in
the background
shorthand property value declaration are set to their
default values.
This property is a shorthand for the following CSS properties:
background-attachment
background-clip
background-color
background-image
background-origin
background-position
background-repeat
background-size
pub fn background_attachment(value: String) -> Style
The background-attachment
CSS property sets whether a background image’s
position is fixed within the viewport,
or scrolls with its containing block.
pub fn background_blend_mode(value: String) -> Style
The background-blend-mode
CSS property sets how an element’s background
images should blend with each other and with the element’s background color.
pub fn background_clip(value: String) -> Style
The background-clip
CSS property sets whether an element’s background
extends underneath its border box, padding box, or content box.
The background is always drawn behind the border, so background-clip: border-box
has a visual effect only when the border is partially opaque or has
transparent or partially opaque regions. Also, the background-clip: text
property has little to no visual effect if the text is fully or partially opaque.
pub fn background_color(value: String) -> Style
pub fn background_image(value: String) -> Style
The background-image
CSS property sets one or more background images on an element.
The background images are drawn on stacking context layers on top of each other. The first layer specified is drawn as if it is closest to the user.
The borders of the element are then drawn on top of them, and the
background-color
is drawn beneath them. How the images are drawn relative
to the box and its borders is defined by the background-clip
and
background-origin
CSS properties.
If a specified image cannot be drawn (for example, when the file denoted by
the specified URI cannot be loaded), browsers handle it as they would a
none
value.
pub fn background_origin(value: String) -> Style
The background-origin
CSS property sets the background’s origin: from the
border start, inside the border, or inside the padding.
Note that background-origin
is ignored when background-attachment
is fixed.
pub fn background_position(value: String) -> Style
The background-position
CSS property sets the initial position for each
background image. The position is relative to the position layer set by
background-origin
.
pub fn background_position_x(value: String) -> Style
The background-position-x
CSS property sets the initial horizontal
position for each background image. The position is relative to the position
layer set by background-origin
.
The value of this property is overridden by any declaration of the background
or background-position
shorthand properties applied to the element after it.
pub fn background_position_y(value: String) -> Style
The background-position-y
CSS property sets the initial vertical
position for each background image. The position is relative to the position
layer set by background-origin
.
The value of this property is overridden by any declaration of the background
or background-position
shorthand properties applied to the element after it.
pub fn background_repeat(value: String) -> Style
The background-repeat
CSS property sets how background images are repeated.
A background image can be repeated along the horizontal and vertical axes,
or not repeated at all.
pub fn background_size(background: String) -> Style
The background-size
CSS property sets the size of the element’s background
image. The image can be left to its natural size, stretched, or constrained
to fit the available space.
Spaces not covered by a background image are filled with the background-color
property, and the background color will be visible behind background images
that have transparency/translucency.
pub fn before(styles: List(Style)) -> Style
In CSS, ::before
creates a pseudo-element
that is the first child of the selected element. It is often used to add
cosmetic content
to an element with the content property. It is inline by default.
pub fn block_size(value: Length) -> Style
The block-size
CSS property defines the horizontal or vertical size of an
element’s block, depending on its writing mode. It corresponds to either the
width
or the height
property, depending on the value of writing-mode
.
If the writing mode is vertically oriented, the value of block-size
relates to the width of the element; otherwise, it relates to the height of
the element. A related property is inline-size
, which defines the other
dimension of the element.
pub fn block_size_(value: String) -> Style
The block-size
CSS property defines the horizontal or vertical size of an
element’s block, depending on its writing mode. It corresponds to either the
width
or the height
property, depending on the value of writing-mode
.
If the writing mode is vertically oriented, the value of block-size
relates to the width of the element; otherwise, it relates to the height of
the element. A related property is inline-size
, which defines the other
dimension of the element.
pub fn border(border: String) -> Style
The border
shorthand CSS property sets an element’s border. It sets the
values of border-width
, border-style
, and border-color
.
This property is a shorthand for the following CSS properties:
pub fn border_block(value: String) -> Style
The border-block
CSS property is a shorthand property for setting the
individual logical block border property values in a single place in the
style sheet.
border-block
can be used to set the values for one or more of
border-block-width
, border-block-style
, and border-block-color
setting
both the start and end in the block dimension at once. The physical borders
to which it maps depends on the element’s writing mode, directionality, and
text orientation. It corresponds to the border-top
and border-bottom
or
border-right
, and border-left
properties depending on the values defined
for writing-mode
, direction
, and text-orientation
.
The borders in the other dimension can be set with border-inline
, which
sets border-inline-start
, and border-inline-end
.
This property is a shorthand for the following CSS properties:
pub fn border_block_color(value: String) -> Style
The border-block-color
CSS property defines the color of the logical block
borders of an element, which maps to a physical border color depending on the
element’s writing mode, directionality, and text orientation. It corresponds
to the border-top-color
and border-bottom-color
, or border-right-color
and border-left-color
property depending on the values defined for writing-mode
,
direction
, and text-orientation
.
The border color in the other dimension can be set with border-inline-color
which sets border-inline-start-color
, and border-inline-end-color
.
pub fn border_block_end(value: String) -> Style
The border-block-end
CSS property is a shorthand property for setting the
individual logical block-end border property values in a single place in the
style sheet.
This property is a shorthand for the following CSS properties:
pub fn border_block_end_color(value: String) -> Style
The border-block-end-color
CSS property defines the color of the logical
block-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_end_style(value: String) -> Style
The border-block-end-style
CSS property defines the style of the logical
block-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-style
, border-right-style
,
border-bottom-style
, or border-left-style
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_end_width(value: Length) -> Style
The border-block-end-width
CSS property defines the width of the logical
block-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-width
, border-right-width
,
border-bottom-width
, or border-left-width
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_end_width_(value: String) -> Style
The border-block-end-width
CSS property defines the width of the logical
block-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-width
, border-right-width
,
border-bottom-width
, or border-left-width
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_start(value: String) -> Style
The border-block-start
CSS property is a shorthand property for setting the
individual logical block-start border property values in a single place in the
style sheet.
This property is a shorthand for the following CSS properties:
pub fn border_block_start_color(value: String) -> Style
The border-block-start-color
CSS property defines the color of the logical
block-start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_start_style(value: String) -> Style
The border-block-start-style
CSS property defines the style of the logical
block-start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-style
, border-right-style
,
border-bottom-style
, or border-left-style
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_start_width(value: Length) -> Style
The border-block-start-width
CSS property defines the width of the logical
block-start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-width
, border-right-width
,
border-bottom-width
, or border-left-width
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_start_width_(value: String) -> Style
The border-block-start-width
CSS property defines the width of the logical
block-start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-width
, border-right-width
,
border-bottom-width
, or border-left-width
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_style(value: String) -> Style
The border-block-style
CSS property defines the style of the logical
block borders of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-style
, border-right-style
,
border-bottom-style
, or border-left-style
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_width(value: Length) -> Style
The border-block-width
CSS property defines the width of the logical
block borders of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-width
, border-right-width
,
border-bottom-width
, or border-left-width
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_block_width_(value: String) -> Style
The border-block-width
CSS property defines the width of the logical
block borders of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text orientation.
It corresponds to the border-top-width
, border-right-width
,
border-bottom-width
, or border-left-width
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_bottom(value: String) -> Style
The border-bottom
shorthand CSS property sets an element’s bottom border.
It sets the values of border-bottom-width
, border-bottom-style
and
border-bottom-color
.
This property is a shorthand for the following CSS properties:
pub fn border_bottom_color(value: String) -> Style
The border-bottom-color
CSS property sets the color of an element’s bottom
border. It can also be set with the shorthand CSS properties border-color
or border-bottom
.
pub fn border_bottom_left_radius(
border_bottom_left_radius: Length,
) -> Style
The border-bottom-left-radius
CSS property rounds the bottom-left corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_bottom_left_radius_(
border_bottom_left_radius: String,
) -> Style
The border-bottom-left-radius
CSS property rounds the bottom-left corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_bottom_right_radius(
border_bottom_right_radius: Length,
) -> Style
The border-bottom-right-radius
CSS property rounds the bottom-right corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_bottom_right_radius_(
border_bottom_right_radius: String,
) -> Style
The border-bottom-right-radius
CSS property rounds the bottom-right corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_bottom_style(value: String) -> Style
The border-bottom-style
CSS property sets the line style of an element’s
bottom border
.
pub fn border_bottom_width(value: Length) -> Style
The border-bottom-width
CSS property sets the width of the bottom border of an element.
pub fn border_bottom_width_(value: String) -> Style
The border-bottom-width
CSS property sets the width of the bottom border of an element.
pub fn border_collapse(value: String) -> Style
The border-collapse
CSS property sets whether cells inside a
<table>
have shared or separate borders.
When cells are collapsed, the border-style
value of inset
behaves like
ridge
, and outset
behaves like groove
.
When cells are separated, the distance between cells is defined by the
border-spacing
property.
pub fn border_color(value: String) -> Style
The border-color
shorthand CSS property sets the color of an element’s border.
Each side can be set individually using border-top-color
, border-right-color
,
border-bottom-color
, and border-left-color
; or using the writing mode-aware
border-block-start-color
, border-block-end-color
, border-inline-start-color
,
and border-inline-end-color
.
You can find out more information about border colors in Applying colors to HTML elements.
pub fn border_end_end_radius(value: String) -> Style
The border-end-end-radius
CSS property defines a logical border radius on
an element, which maps to a physical border radius that depends on the
element’s writing-mode
, direction
, and text-orientation
. This is
useful when building styles to work regardless of the text orientation and
writing mode.
This property affects the corner between the block-end and the inline-end
sides of the element. For instance, in a horizontal-tb
writing mode with
ltr
direction, it corresponds to the border-bottom-right-radius
property.
pub fn border_end_start_radius(value: String) -> Style
The border-end-end-radius
CSS property defines a logical border radius on
an element, which maps to a physical border radius that depends on the
element’s writing-mode
, direction
, and text-orientation
. This is
useful when building styles to work regardless of the text orientation and
writing mode.
This property affects the corner between the block-end and the inline-start
sides of the element. For instance, in a horizontal-tb
writing mode with
ltr
direction, it corresponds to the border-bottom-left-radius
property.
pub fn border_image(value: String) -> Style
The border-image
CSS property draws an image around a given element.
It replaces the element’s regular border.
This property is a shorthand for the following CSS properties:
pub fn border_image_outset(value: Length) -> Style
The border-image-outset
CSS property sets the distance by which an
element’s border image is set out from its border box.
The parts of the border image that are rendered outside the element’s border
box with border-image-outset
do not trigger overflow scrollbars and don’t
capture mouse events.
pub fn border_image_outset_(value: String) -> Style
The border-image-outset
CSS property sets the distance by which an
element’s border image is set out from its border box.
The parts of the border image that are rendered outside the element’s border
box with border-image-outset
do not trigger overflow scrollbars and don’t
capture mouse events.
pub fn border_image_repeat(value: String) -> Style
The border-image-repeat
CSS property defines how the edge regions and
middle region of a source image are adjusted to fit the dimensions of an
element’s border image. The middle region can be displayed by using the
keyword “fill” in the border-image-slice
property.
pub fn border_image_slice(value: String) -> Style
The border-image-slice
CSS property divides the image specified by
border-image-source
into regions. These regions form the components of
an element’s border image.
pub fn border_image_source(value: String) -> Style
The border-image-source
CSS property sets the source image used to create
an element’s border image.
The border-image-slice
property is used to divide the source image into
regions, which are then dynamically applied to the final border image.
pub fn border_image_width(value: Length) -> Style
The border-image-width
CSS property sets the width of an element’s border image.
If this property’s value is greater than the element’s border-width
, the
border image will extend beyond the padding (and/or content) edge.
pub fn border_image_width_(value: String) -> Style
The border-image-width
CSS property sets the width of an element’s border image.
If this property’s value is greater than the element’s border-width
, the
border image will extend beyond the padding (and/or content) edge.
pub fn border_inline(value: String) -> Style
The border-inline
CSS property is a shorthand property for setting the
individual logical inline border property values in a single place in the
style sheet.
The physical borders to which border-inline
maps depends on the element’s
writing mode, directionality, and text orientation. It corresponds to the
border-top
and border-bottom
or border-right
, and border-left
properties, depending on the values defined for writing-mode
, direction
,
and text-orientation
.
The borders in the other dimension can be set with border-block
, which
sets border-block-start
, and border-block-end
.
This property is a shorthand for the following CSS properties:
pub fn border_inline_color(value: String) -> Style
Theè border-inline-colorCSS property defines the color of the logical inline borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the
border-top-colorand
border-bottom-color, or
border-right-colorand
border-left-colorproperty depending on the values defined for
writing-mode,
direction, and
text-orientation`.
The border color in the other dimension can be set with border-block-color
which sets border-block-start-color
, and border-block-end-color
.
pub fn border_inline_end(value: String) -> Style
The border-inline-end
CSS property is a shorthand property for setting the
individual logical inline-end border property values in a single place in
the style sheet.
This property is a shorthand for the following CSS properties:
pub fn border_inline_end_color(value: String) -> Style
The border-inline-end-color
CSS property defines the color of the logical
inline-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_end_style(value: String) -> Style
The border-inline-end-style
CSS property defines the style of the logical
inline-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_end_width(value: Length) -> Style
The border-inline-end-width
CSS property defines the width of the logical
inline-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_end_width_(value: String) -> Style
The border-inline-end-width
CSS property defines the width of the logical
inline-end border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_start(value: String) -> Style
The border-inline-start
CSS property is a shorthand property for setting the
individual logical inline-start border property values in a single place in
the style sheet.
This property is a shorthand for the following CSS properties:
pub fn border_inline_start_color(value: String) -> Style
The border-inline-start-color
CSS property defines the color of the logical
inline start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_start_style(value: String) -> Style
The border-inline-start-style
CSS property defines the style of the logical
inline start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_start_width(value: Length) -> Style
The border-inline-start-width
CSS property defines the width of the logical
inline start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_start_width_(value: String) -> Style
MDN Reference
The border-inline-start-width
CSS property defines the width of the logical
inline start border of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-color
, border-right-color
,
border-bottom-color
, or border-left-color
property depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_style(value: String) -> Style
The border-inline-style
CSS property defines the style of the logical
inline borders of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-style
, border-bottom-style
,
border-left-style
, or border-right-style
properties depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_width(value: Length) -> Style
The border-inline-width
CSS property defines the width of the logical
inline borders of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-width
, border-bottom-width
,
border-left-width
, or border-right-width
properties depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_inline_width_(value: String) -> Style
The border-inline-width
CSS property defines the width of the logical
inline borders of an element, which maps to a physical border color
depending on the element’s writing mode, directionality, and text
orientation. It corresponds to the border-top-width
, border-bottom-width
,
border-left-width
, or border-right-width
properties depending on the
values defined for writing-mode
, direction
, and text-orientation
.
pub fn border_left(value: String) -> Style
The border-top
shorthand CSS property sets all the properties of an
element’s left border.
This property is a shorthand for the following CSS properties:
pub fn border_left_color(value: String) -> Style
The border-left-color
CSS property sets the color of an element’s left
border. It can also be set with the shorthand CSS properties border-color
or border-left
.
pub fn border_left_style(value: String) -> Style
pub fn border_left_width(value: Length) -> Style
pub fn border_left_width_(value: String) -> Style
pub fn border_radius(border_radius: Length) -> Style
The border-radius
CSS property rounds the corners of an element’s outer
border edge. You can set a single radius to make circular corners, or two
radii to make elliptical corners.
The radius applies to the whole background
, even if the element has no
border; the exact position of the clipping is defined by the
background-clip
property.
The border-radius
property does not apply to table elements when
border-collapse
is collapse
.
This property is a shorthand for the following CSS properties:
pub fn border_radius_(border_radius: String) -> Style
The border-radius
CSS property rounds the corners of an element’s outer
border edge. You can set a single radius to make circular corners, or two
radii to make elliptical corners.
The radius applies to the whole background
, even if the element has no
border; the exact position of the clipping is defined by the
background-clip
property.
The border-radius
property does not apply to table elements when
border-collapse
is collapse
.
This property is a shorthand for the following CSS properties:
pub fn border_right(value: String) -> Style
The border-right
shorthand CSS property sets all the properties of an
element’s right border.
This property is a shorthand for the following CSS properties:
pub fn border_right_color(value: String) -> Style
The border-right-color
CSS property sets the color of an element’s right
border. It can also be set with the shorthand CSS properties border-color
or border-right
.
pub fn border_right_style(value: String) -> Style
pub fn border_right_width(value: Length) -> Style
pub fn border_right_width_(value: String) -> Style
pub fn border_spacing(value: Length) -> Style
The border-spacing
CSS property sets the distance between the borders of
adjacent cells in a <table>
. This property applies only when border-collapse
is separate
.
The border-spacing
value is also used along the outside edge of the table,
where the distance between the table’s border and the cells in the first/last
column or row is the sum of the relevant (horizontal or vertical)
border-spacing
and the relevant (top, right, bottom, or left) padding
on the table.
pub fn border_spacing_(value: String) -> Style
The border-spacing
CSS property sets the distance between the borders of
adjacent cells in a <table>
. This property applies only when border-collapse
is separate
.
The border-spacing
value is also used along the outside edge of the table,
where the distance between the table’s border and the cells in the first/last
column or row is the sum of the relevant (horizontal or vertical)
border-spacing
and the relevant (top, right, bottom, or left) padding
on the table.
pub fn border_start_end_radius(value: String) -> Style
The border-start-end-radius
CSS property defines a logical border radius on
an element, which maps to a physical border radius that depends on the
element’s writing-mode
, direction
, and text-orientation
. This is
useful when building styles to work regardless of the text orientation and
writing mode.
This property affects the corner between the block-end and the inline-start
sides of the element. For instance, in a horizontal-tb
writing mode with
ltr
direction, it corresponds to the border-top-right-radius
property.
pub fn border_start_start_radius(value: String) -> Style
The border-start-start-radius
CSS property defines a logical border radius on
an element, which maps to a physical border radius that depends on the
element’s writing-mode
, direction
, and text-orientation
. This is
useful when building styles to work regardless of the text orientation and
writing mode.
This property affects the corner between the block-end and the inline-start
sides of the element. For instance, in a horizontal-tb
writing mode with
ltr
direction, it corresponds to the border-top-left-radius
property.
pub fn border_style(value: String) -> Style
The border-style
shorthand CSS property sets the line style for all four
sides of an element’s border.
This property is a shorthand for the following CSS properties:
pub fn border_top(value: String) -> Style
The border-top
shorthand CSS property sets all the properties of an
element’s top border.
This property is a shorthand for the following CSS properties:
pub fn border_top_color(value: String) -> Style
The border-top-color
CSS property sets the color of an element’s top
border. It can also be set with the shorthand CSS properties border-color
or border-top
.
pub fn border_top_left_radius(
border_top_left_radius: Length,
) -> Style
The border-top-left-radius
CSS property rounds the top-left corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_top_left_radius_(
border_top_left_radius: String,
) -> Style
The border-top-left-radius
CSS property rounds the top-left corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_top_right_radius(
border_top_right_radius: Length,
) -> Style
The border-top-right-radius
CSS property rounds the top-right corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_top_right_radius_(
border_top_right_radius: String,
) -> Style
The border-top-right-radius
CSS property rounds the top-right corner
of an element by specifying the radius (or the radius of the semi-major and
semi-minor axes) of the ellipse defining the curvature of the corner.
The rounding can be a circle or an ellipse, or if one of the value is 0
no rounding is done and the corner is square.
A background, being an image or a color, is clipped at the border, even a
rounded one; the exact location of the clipping is defined by the value of
the background-clip
property.
pub fn border_top_style(value: String) -> Style
pub fn border_top_width(value: Length) -> Style
pub fn border_top_width_(value: String) -> Style
pub fn border_width(value: Length) -> Style
The border-width
shorthand CSS property sets the width of an element’s border.
This property is a shorthand for the following CSS properties:
pub fn border_width_(value: String) -> Style
The border-width
shorthand CSS property sets the width of an element’s border.
This property is a shorthand for the following CSS properties:
pub fn bottom(size: Length) -> Style
The bottom
CSS property participates in setting the vertical position of a
positioned element.
This inset property
has no effect on non-positioned elements.
The effect of bottom
depends on how the element is positioned (i.e., the
value of the position
property):
- When
position
is set toabsolute
orfixed
, the bottom property specifies the distance between the outer edge of the element’s bottom margin and the outer edge of the containing block’s bottom padding, or, in the case of anchor positioned elements when theanchor()
function is used within the value, relative to the position of the specified<anchor-side>
edge. Thebottom
property is compatible with thetop
,bottom
,start
,end
,self-start
,self-end
,center
, and<percentage>
values. - When
position
is set torelative
, thebottom
property specifies the distance the element’s bottom edge is moved above its normal position. - When
position
is set tosticky
, thebottom
property is used to compute the sticky-constraint rectangle. - When
position
is set tostatic
, thebottom
property has no effect.
When both top
and bottom
are specified, position
is set to absolute
or fixed
, and height
is unspecified (either auto
or 100%
) both the
top
and bottom
distances are respected. In all other situations, if
height
is constrained in any way or position
is set to relative
, the
top
property takes precedence and the bottom
property is ignored.
pub fn bottom_(size: String) -> Style
The bottom
CSS property participates in setting the vertical position of a
positioned element.
This inset property
has no effect on non-positioned elements.
The effect of bottom
depends on how the element is positioned (i.e., the
value of the position
property):
- When
position
is set toabsolute
orfixed
, the bottom property specifies the distance between the outer edge of the element’s bottom margin and the outer edge of the containing block’s bottom padding, or, in the case of anchor positioned elements when theanchor()
function is used within the value, relative to the position of the specified<anchor-side>
edge. Thebottom
property is compatible with thetop
,bottom
,start
,end
,self-start
,self-end
,center
, and<percentage>
values. - When
position
is set torelative
, thebottom
property specifies the distance the element’s bottom edge is moved above its normal position. - When
position
is set tosticky
, thebottom
property is used to compute the sticky-constraint rectangle. - When
position
is set tostatic
, thebottom
property has no effect.
When both top
and bottom
are specified, position
is set to absolute
or fixed
, and height
is unspecified (either auto
or 100%
) both the
top
and bottom
distances are respected. In all other situations, if
height
is constrained in any way or position
is set to relative
, the
top
property takes precedence and the bottom
property is ignored.
pub fn box_shadow(box_shadow: String) -> Style
The box-shadow
CSS property adds shadow effects around an element’s frame.
You can set multiple effects separated by commas. A box shadow is described
by X and Y offsets relative to the element, blur and spread radius, and color.
The box-shadow
property enables you to cast a drop shadow from the frame
of almost any element. If a border-radius
is specified on the element with
a box shadow, the box shadow takes on the same rounded corners. The
z-ordering of multiple box shadows is the same as multiple
text shadows
(the first specified shadow is on top).
Box-shadow generator
is an interactive tool allowing you to generate a box-shadow
.
pub fn box_sizing(box_sizing: String) -> Style
The box-sizing
CSS property sets how the total width and height of an
element is calculated.
By default in the CSS box model,
the width
and height
you assign to an element is applied only to the
element’s content box. If the element has any border or padding, this is
then added to the width
and height
to arrive at the size of the box
that’s rendered on the screen. This means that when you set width
and
height
, you have to adjust the value you give to allow for any border or
padding that may be added. For example, if you have four boxes with
width: 25%;
, if any has left or right padding or a left or right border,
they will not by default fit on one line within the constraints of the
parent container.
The box-sizing
property can be used to adjust this behavior:
content-box
gives you the default CSS box-sizing behavior. If you set an element’s width to 100 pixels, then the element’s content box will be 100 pixels wide, and the width of any border or padding will be added to the final rendered width, making the element wider than 100px.border-box
tells the browser to account for any border and padding in the values you specify for an element’s width and height. If you set an element’s width to 100 pixels, that 100 pixels will include any border or padding you added, and the content box will shrink to absorb that extra width. This typically makes it much easier to size elements.
box-sizing: border-box
is the default styling that browsers use for the<table>
,<select>
, and<button>
elements, and for<input>
elements whose type isradio
,checkbox
,reset
,button
,submit
,color
, orsearch
.
It is often useful to set
box-sizing
toborder-box
to lay out elements. This makes dealing with the sizes of elements much easier, and generally eliminates a number of pitfalls you can stumble on while laying out your content. On the other hand, when usingposition: relative
orposition: absolute
, use ofbox-sizing: content-box
allows the positioning values to be relative to the content, and independent of changes to border and padding sizes, which is sometimes desirable.
pub fn break_after(value: String) -> Style
The break-after
CSS property sets how page, column, or region breaks
should behave after a generated box. If there is no generated box,
the property is ignored.
pub fn break_before(value: String) -> Style
The break-before
CSS property sets how page, column, or region breaks
should behave before a generated box. If there is no generated box,
the property is ignored.
pub fn break_inside(value: String) -> Style
The break-inside
CSS property sets how page, column, or region breaks
should behave inside a generated box. If there is no generated box,
the property is ignored.
pub fn buffering(styles: List(Style)) -> Style
The :buffering
CSS
pseudo-class
selector represents an element that is playable, such as <audio>
or <video>
,
when the playable element is buffering a media resource.
An element is considered as buffering when that element cannot continue playing because it is trying to load media data but does not yet have enough data to begin or continue playback. For more information, see the Media buffering, seeking, and time ranges guide.
pub fn caption_side(value: String) -> Style
The caption-side
CSS property puts the content of a table’s <caption>
on
the specified side. The values are relative to the writing-mode
of the table.
pub fn caret_color(value: String) -> Style
The caret-color
CSS property sets the color of the insertion caret, the
visible marker where the next character typed will be inserted. This is
sometimes referred to as the text input cursor. The caret appears in
elements such as <input>
or those with the contenteditable
attribute.
The caret is typically a thin vertical line that flashes to help make it
more noticeable. By default, it is black, but its color can be altered with
this property.
Note that the insertion caret is only one type of caret. For example, many
browsers have a “navigation caret,” which acts similarly to an insertion
caret but can be moved around in non-editable text. On the other hand, the
mouse cursor image shown when hovering over text where the cursor
property
is auto
, or when hovering over an element where the cursor
property is
text
or vertical-text
, though it sometimes looks like a caret,
is not a caret (it’s a cursor).
pub fn checked(styles: List(Style)) -> Style
The :checked
CSS
pseudo-class
selector represents any radio (<input type="radio">
),
checkbox (<input type="checkbox">
), or
option (<option>
in a
<select>
)
element that is checked or toggled to an on
state.
pub fn child(class: Class, styles: List(Style)) -> Style
The child combinator (>
) is placed between two CSS selectors. It matches
only those elements matched by the second selector that are the direct
children of elements matched by the first.
/* List items that are children of the "my-things" list */
ul.my-things > li {
margin: 2em;
}
Elements matched by the second selector must be the immediate children of the elements matched by the first selector. This is stricter than the descendant combinator, which matches all elements /// matched by the second selector for which there exists an ancestor element matched by the first selector, regardless of the number of “hops” up the DOM.
pub fn class(styles: List(Style)) -> Class
pub fn clear(value: String) -> Style
The clear
CSS property sets whether an element must be moved below
(cleared) floating elements that precede it. The clear
property applies
to floating and non-floating elements.
When applied to non-floating blocks, it moves the border edge of the element down until it is below the margin edge of all relevant floats. The non-floated block’s top margin collapses.
Vertical margins between two floated elements on the other hand will not collapse. When applied to floating elements, the margin edge of the bottom element is moved below the margin edge of all relevant floats. This affects the position of later floats, since later floats cannot be positioned higher than earlier ones.
The floats that are relevant to be cleared are the earlier floats within the same block formatting context.
If an element contains only floated elements, its height collapses to nothing. If you want it to always be able to resize, so that it contains floating elements inside it, set the value of the element’s
display
property toflow-root
.#container { display: flow-root; }
pub fn clip_path(value: String) -> Style
The clip-path
CSS property creates a clipping region that sets what part
of an element should be shown. Parts that are inside the region are shown,
while those outside are hidden.
pub fn color(color: String) -> Style
The color
CSS property sets the foreground
color value
of an element’s text and
text decorations,
and sets the
currentcolor
value. currentcolor
may be used as an indirect value on other properties
and is the default for other color properties, such as border-color
.
For an overview of using color in HTML, see Applying color to HTML elements using CSS.
pub fn color_interpolation(value: String) -> Style
The color-interpolation
CSS property is used in SVG to specify which color
space to use for <linearGradient>
and <radialGradient>
SVG elements.
pub fn color_interpolation_filters(value: String) -> Style
The color-interpolation-filters
CSS property specifies the color space for
imaging operations performed via SVG filter effects. If explicitly declared,
the value of the CSS property overrides any value given in the element’s
color-interpolation-filters
attribute.
The
color-interpolation-filters
property is only relevant to SVG filter operations. It has no effect on filter primitives like<feOffset>
,<feImage>
,<feTile>
, and<feFlood>
, but instead applies to the various filter effect elements (e.g.,<feBlend>
); see the SVGcolor-interpolation-filters
page for a full list.
It is important to remember that the SVG
color-interpolation
attribute has an initial value ofsRGB
, whilecolor-interpolation-filters
has an initial value oflinearRGB
. This means, in the default case, filter effect interpolations occur in a different color space than all other color interpolations.
pub fn color_scheme(value: String) -> Style
The color-scheme
CSS property allows an element to indicate which color
schemes it can comfortably be rendered in. User agents change the following
aspects of the UI chrome to match the used color scheme:
- The color of the canvas surface.
- The default colors of scrollbars and other interaction UI.
- The default colors of form controls.
- The default colors of other browser-provided UI, such as “spellcheck” underlines.
Component authors must use the
prefers-color-scheme
media feature to support the color schemes on the rest of the elements.
Common choices for operating system color schemes are “light” and “dark”, or “day mode” and “night mode”. When a user selects one of these color schemes, the operating system makes adjustments to the user interface. This includes form controls, scrollbars, and the used values of CSS system colors.
pub fn column_count(value: String) -> Style
The column-count
CSS property breaks an element’s content into the specified
number of columns.
pub fn column_fill(value: String) -> Style
The column-fill
CSS property controls how an element’s contents are balanced
when broken into columns.
pub fn column_gap(column_gap: Length) -> Style
The column-gap
CSS property sets the size of the gap
(gutter)
between an element’s columns.
Initially a part of
Multi-column Layout,
the definition of column-gap
has been broadened to include multiple
layout methods. Now specified in
CSS box alignment,
it may be used in multi-column, flexible box, and grid layouts.
Early versions of the specification called this property grid-column-gap
,
and to maintain compatibility with legacy websites, browsers will still
accept grid-column-gap
as an alias for column-gap
.
pub fn column_rule(value: String) -> Style
The column-rule
shorthand CSS property sets the width, style, and color
of the line drawn between columns in a multi-column layout.
This property is a shorthand for the following CSS properties:
pub fn column_rule_color(value: String) -> Style
The column-rule-color
CSS property sets the color of the line drawn
between columns in a multi-column layout.
pub fn column_rule_style(value: String) -> Style
The column-rule-style
CSS property sets the style of the line drawn
between columns in a multi-column layout.
pub fn column_rule_width(value: String) -> Style
The column-rule-width
CSS property sets the width of the line drawn
between columns in a multi-column layout.
pub fn column_span(value: String) -> Style
The column-span
CSS property makes it possible for an element to span
across all columns when its value is set to all
.
An element that spans more than one column is called a spanning element.
pub fn column_width(value: String) -> Style
The column-width
CSS property sets the ideal column width in a
multi-column layout. The container will have as many columns as can fit
without any of them having a width less than the column-width
value. If
the width of the container is narrower than the specified value, the single
column’s width will be smaller than the declared column width.
This property can help you create responsive designs that fit different
screen sizes. Especially in the presence of the column-count
property
(which has precedence), you must specify all related length values to
achieve an exact column width. In horizontal text these are width
,
column-width
, column-gap
, and column-rule-width
.
pub fn columns(value: String) -> Style
The columns
CSS shorthand property sets the number of columns to use when
drawing an element’s contents, as well as those columns’ widths.
This property is a shorthand for the following CSS properties:
pub fn compose(class: Class) -> Style
Compose styles by inheriting class, and later overrides them. Every styles from the class will be composed in the resulting class. Order is important, as last properties will override previous properties.
pub fn my_class1() {
css.class([
css.background("red"),
])
}
pub fn my_class2() {
css.class([
css.padding(px(10)),
css.color("red"),
])
}
pub fn my_class() {
css.class([
css.compose(my_class1()),
css.compose(my_class2()),
css.padding(px(20)),
])
}
Will output
.my_class {
background: red;
color: red;
padding: 20px;
}
pub fn contain(value: String) -> Style
The contain
CSS property indicates that an element and its contents are,
as much as possible, independent from the rest of the document tree.
Containment enables isolating a subsection of the DOM, providing performance
benefits by limiting calculations of layout, style, paint, size, or any
combination to a DOM subtree rather than the entire page. Containment can
also be used to scope CSS counters and quotes.
There are four types of CSS containment: size, layout, style, and paint, which are set on the container. The property is a space-separated list of a subset of the five standard values or one of the two shorthand values. Changes to the contained properties within the container are not propagated outside of the contained element to the rest of the page. The main benefit of containment is that the browser does not have to re-render the DOM or page layout as often, leading to small performance benefits during the rendering of static pages and greater performance benefits in more dynamic applications.
Using the contain
property is useful on pages with groups of elements
that are supposed to be independent, as it can prevent element internals
from having side effects outside of its bounding-box.
Using
layout
,paint
,strict
orcontent
values for this property creates:
- A new containing block (for the descendants whose
position
property isabsolute
orfixed
).- A new stacking context.
- A new block formatting context.
pub fn contain_intrinsic_block_size(value: Length) -> Style
The contain-intrinsic-block-size
CSS logical property
defines the block size of an element that a browser can use for layout when
the element is subject to
size containment.
Block size is the size of an element in the dimension perpendicular to the flow of text within a line. In a horizontal writing mode like standard English, block size is the vertical dimension (height); in a vertical writing mode, block size is the horizontal dimension.
pub fn contain_intrinsic_block_size_(value: String) -> Style
The contain-intrinsic-block-size
CSS logical property
defines the block size of an element that a browser can use for layout when
the element is subject to
size containment.
Block size is the size of an element in the dimension perpendicular to the flow of text within a line. In a horizontal writing mode like standard English, block size is the vertical dimension (height); in a vertical writing mode, block size is the horizontal dimension.
pub fn contain_intrinsic_height(value: Length) -> Style
The contain-intrinsic-block-height
CSS property sets the height of an
element that a browser can use for layout when the element is subject to
size containment.
pub fn contain_intrinsic_height_(value: String) -> Style
The contain-intrinsic-block-height
CSS property sets the height of an
element that a browser can use for layout when the element is subject to
size containment.
pub fn contain_intrinsic_inline_size(value: Length) -> Style
The contain-intrinsic-inline-size
CSS logical property
defines the inline-size of an element that a browser can use for layout
when the element is subject to
size containment.
Inline-size is the size of the element in the dimension parallel to the flow of text within a line. In a horizontal writing mode like standard English, inline size is the horizontal dimension (width); for a vertical writing mode, inline size is the vertical dimension.
pub fn contain_intrinsic_inline_size_(value: String) -> Style
The contain-intrinsic-inline-size
CSS logical property
defines the inline-size of an element that a browser can use for layout
when the element is subject to
size containment.
Inline-size is the size of the element in the dimension parallel to the flow of text within a line. In a horizontal writing mode like standard English, inline size is the horizontal dimension (width); for a vertical writing mode, inline size is the vertical dimension.
pub fn contain_intrinsic_size(value: Length) -> Style
The contain-intrinsic-size CSS shorthand property sets the size of an element that a browser will use for layout when the element is subject to size containment.
This property is a shorthand for the following CSS properties:
pub fn contain_intrinsic_size_(value: String) -> Style
The contain-intrinsic-size CSS shorthand property sets the size of an element that a browser will use for layout when the element is subject to size containment.
This property is a shorthand for the following CSS properties:
pub fn contain_intrinsic_width(value: Length) -> Style
The contain-intrinsic-width
CSS property sets the width of an element that
a browser will use for layout when the element is subject to
size containment.
pub fn contain_intrinsic_width_(value: String) -> Style
The contain-intrinsic-width
CSS property sets the width of an element that
a browser will use for layout when the element is subject to
size containment.
pub fn container(value: String) -> Style
The container
shorthand CSS property establishes the element as a query
container and specifies the name and type of the
containment context
used in a container query.
This property is a shorthand for the following CSS properties:
pub fn container_name(value: String) -> Style
The container-name
CSS property specifies a list of query container names
used by the @container
at-rule in a
container query.
A container query will apply styles to elements based on the size of the
nearest ancestor with a containment context. When a containment context is
given a name, it can be specifically targeted using the
@container
at-rule instead of the nearest ancestor with containment.
When using the
container-type
andcontainer-name
properties, thestyle
andlayout
values of thecontain
property are automatically applied.
pub fn container_type(value: String) -> Style
An element can be established as a query container for
container size queries
using the container-type
CSS property. container-type
is used to define
the type of size containment used in a container query.
Length containment turns off the ability of an element to get size information from its contents, which is important for container queries to avoid infinite loops. If this were not the case, a CSS rule inside a container query could change the content size, which in turn could make the query evaluate to false and change the parent element’s size, which in turn could change the content size and flip the query back to true, and so on.
The container size has to be set explicitly or by context — for example, block elements, flex containers, and grid containers stretching to the full width of their parent. If an explicit or contextual size is not available, elements with size containment will collapse.
When using the
container-type
andcontainer-name
properties, thestyle
andlayout
values of thecontain
property are automatically applied.
pub fn content(value: String) -> Style
The content
CSS property replaces content with a generated value. It can
be used to define what is rendered inside an element or pseudo-element. For
elements, the content
property specifies whether the element renders
normally (normal
or none
) or is replaced with an image (and associated
“alt” text). For pseudo-elements and margin boxes, content
defines the
content as images, text, both, or none, which determines whether the element
renders at all.
Objects inserted using the content
property are anonymous
replaced elements.
pub fn content_visibility(value: String) -> Style
The content-visibility
CSS property controls whether or not an element
renders its contents at all, along with forcing a strong set of containments,
allowing user agents to potentially omit large swathes of layout and
rendering work until it becomes needed. It enables the user agent to skip
an element’s rendering work (including layout and painting) until it is
needed — which makes the initial page load much faster.
The
contentvisibilityautostatechange
event fires on any element withcontent-visibility: auto
set on it when its rendering work starts or stops being skipped. This provides a convenient way for an app’s code to start or stop rendering processes (e.g. drawing on a<canvas>
) when they are not needed, thereby conserving processing power.
pub fn counter_increment(value: String) -> Style
The counter-increment
CSS property can be used to increase or decrease
the value of the named
CSS counters
by the specified values, or to prevent all counters or an individual
counter’s value from being changed.
If a named counter in the list of space-separated counters and values doesn’t
exist, it will be created. If no value is provided for a counter in the list
of counters, the counter will be increased by 1
.
The counter’s value can be reset to any integer value with the
counter-reset
CSS property.
pub fn counter_reset(value: String) -> Style
The counter-reset
CSS property creates named
CSS counters
and initializes them to a specific value. It supports creating counters that
count up from one to the number of elements, as well as those that count
down from the number of elements to one.
pub fn counter_set(value: String) -> Style
The counter-set
CSS property sets
CSS counters
on the element to the given values.
If the counters don’t exist the counter-set
property creates a new counter
for each named counter in the list of space-separated counter and value pairs.
However, to create a new counter it is recommended to use the counter-reset
CSS property.
If a named counter in the list is missing a value, the value of the counter
will be set to 0
.
pub fn cue(styles: List(Style)) -> Style
The ::cue
CSS
pseudo-element
matches WebVTT
cues within a selected element. This can be used to
style captions and other cues
in media with VTT tracks.
pub fn cursor(cursor: String) -> Style
The cursor
CSS property sets the mouse cursor, if any, to show when the
mouse pointer is over an element.
The cursor setting should inform users of the mouse operations that can be performed at the current location, including: text selection, activating help or context menus, copying content, resizing tables, and so on. You can specify either the type of cursor using a keyword, or load a specific icon to use (with optional fallback images and mandatory keyword as a final fallback).
pub fn default(styles: List(Style)) -> Style
The :default
CSS
pseudo-class
selects form elements that are the default in a group of related elements.
pub fn defined(styles: List(Style)) -> Style
The :defined
CSS
pseudo-class
represents any element that has been defined. This includes any standard
element built into the browser and custom elements that have been
successfully defined (i.e. with the
CustomElementRegistry.define()
method).
pub fn descendant(class: Class, styles: List(Style)) -> Style
The descendant combinator — typically represented by a single space (“ “) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent’s parent, parent’s parent’s parent, etc.) element matching the first selector. Selectors that utilize a descendant combinator are called descendant selectors.
/* List items that are descendants of the "my-things" list */
ul.my-things li {
margin: 2em;
}
The descendant combinator is technically one or more CSS white space characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. Additionally, the white space characters of which the combinator is comprised may contain any number of CSS comments.
pub fn dir(direction: String, styles: List(Style)) -> Style
The :dir()
CSS
pseudo-class
matches elements based on the directionality of the text contained in them.
/* Selects any element with right-to-left text */
:dir(rtl) {
background-color: red;
}
The :dir()
pseudo-class uses only the semantic value of the
directionality, i.e., the one defined in the document itself. It doesn’t
account for styling directionality, i.e., the directionality set by CSS
properties such as direction.
Be aware that the behavior of the
:dir()
pseudo-class is not equivalent to the[dir=…]
attribute selectors. The latter match the HTMLdir
attribute, and ignore elements that lack it — even if they inherit a direction from their parent. (Similarly,[dir=rtl]
and[dir=ltr]
won’t match theauto
value.) In contrast,:dir()
will match the value calculated by the user agent, even if inherited.
pub fn direction(direction: String) -> Style
Where possible, authors are encouraged to avoid using the
direction
CSS property and use the HTMLdir
global attribute instead.
The direction
CSS property sets the direction of text, table columns, and
horizontal overflow. Use rtl
for languages written from right to left
(like Hebrew or Arabic), and ltr
for those written from left to right
(like English and most other languages).
Note that text direction is usually defined within a document (e.g.,
with HTML’s dir
attribute) rather than through direct use of the
direction property.
The property sets the base text direction of block-level elements and the
direction of embeddings created by the unicode-bidi
property. It also sets
the default alignment of text, block-level elements, and the direction that
cells flow within a table row.
Unlike the dir
attribute in HTML, the direction
property is not inherited
from table columns into table cells, since CSS inheritance follows the
document tree, and table cells are inside of rows but not inside of columns.
The direction
and unicode-bidi
properties are the two only properties
which are not affected by the all
shorthand property.
pub fn disabled(styles: List(Style)) -> Style
The :disabled
CSS
pseudo-class
represents any disabled element. An element is disabled if it can’t be
activated (selected, clicked on, typed into, etc.) or accept focus. The
element also has an enabled state, in which it can be activated or accept
focus.
pub fn display(display: String) -> Style
The display
CSS property sets whether an element is treated as a
block or inline box
and the layout used for its children, such as
flow layout,
grid or
flex.
Formally, the display
property sets an element’s inner and outer display
types. The outer type sets an element’s participation in
flow layout;
the inner type sets the layout of children. Some values of display
are
fully defined in their own individual specifications; for example the detail
of what happens when display: flex
is declared is defined in the CSS
Flexible Box Model specification.
pub fn empty(styles: List(Style)) -> Style
The :empty
CSS
pseudo-class
represents any element that has no children. Children can be either element
nodes or text (including whitespace). Comments, processing instructions, and
CSS content
do
not affect whether an element is considered empty.
pub fn empty_cells(empty_cells: String) -> Style
The empty-cells
CSS property sets whether borders and backgrounds appear
around <table>
cells that have no visible content.
This property has an effect only when the border-collapse
property is separate
.
pub fn enabled(styles: List(Style)) -> Style
The :enabled
CSS
pseudo-class
represents any enabled element. An element is enabled if it can be activated
(selected, clicked on, typed into, etc.) or accept focus. The element also
has a disabled state, in which it can’t be activated or accept focus.
pub fn field_sizing(field_sizing: String) -> Style
The field-sizing
CSS property enables you to control the sizing behavior of
elements that are given a default preferred size, such as form control
elements. This property enables you to override the default sizing behavior,
allowing form controls to adjust in size to fit their contents.
This property is typically used to style text <input>
and <textarea>
elements to allow them to shrinkwrap their content as well as grow when more
text is entered into the form control.
pub fn file_selector_button(styles: List(Style)) -> Style
The ::file-selector-button
CSS
pseudo-element represents the
button of an
<input>
of
type="file"
.
pub fn filter(filter: String) -> Style
The filter
CSS property applies graphical effects like blur or color shift
to an element. Filters are commonly used to adjust the rendering of images,
backgrounds, and borders.
Several functions,
such as blur()
and contrast()
, are available to help you achieve
predefined effects.
pub fn first_child(styles: List(Style)) -> Style
The :first-child
CSS
pseudo-class
represents the first element among a group of sibling elements.
pub fn first_letter(styles: List(Style)) -> Style
The ::first-letter
CSS
pseudo-element
applies styles to the first letter of the first line of a
block container,
but only when not preceded by other content (such as images or inline tables).
pub fn first_line(styles: List(Style)) -> Style
The ::first-line
CSS
pseudo-element
applies styles to the first line of a
block container.
pub fn first_of_type(styles: List(Style)) -> Style
The :first-of-type
CSS
pseudo-class
represents the first element of its type among a group of sibling elements.
pub fn flex(flex: String) -> Style
The flex
CSS shorthand property sets how a
flex item
will grow or shrink to fit the space available in its flex container.
This property is a shorthand for the following CSS properties:
pub fn flex_basis(flex_basis: String) -> Style
The flex-basis
CSS property sets the initial main size of a
flex item.
It sets the size of the content box unless otherwise set with box-sizing
.
It is recommended to use the flex shorthand instead of separate
flex-grow
,flex-shrink
, andflex-basis
declarations. We have separated them here as this document is about one of the shorthand components: theflex-basis
property.
pub fn flex_direction(flex_direction: String) -> Style
The flex-direction
CSS property sets how flex items are placed in the flex
container defining the main axis and the direction (normal or reversed).
Note that the values row
and row-reverse
are affected by the
directionality of the flex container. If its
dir
attribute is ltr
, row
represents the horizontal axis oriented from the
left to the right, and row-reverse
from the right to the left; if the dir
attribute is rtl
, row
represents the axis oriented from the right to the
left, and row-reverse
from the left to the right.
pub fn flex_flow(flex_flow: String) -> Style
The flex-flow
CSS shorthand property specifies the direction of a flex
container, as well as its wrapping behavior.
This property is a shorthand for the following CSS properties:
pub fn flex_grow(flex_grow: Int) -> Style
The flex-grow
CSS property sets the flex grow factor, which specifies how
much of the flex container’s
positive free space,
if any, should be assigned to the flex item’s
main size.
When the flex-container’s main size is larger than the combined main sizes of its flex items, this positive free space can be distributed among the flex items, with each item’s growth being their growth factor value as a p roportion of the sum total of all the flex items’ flex grow factors.
It is recommended to use the flex shorthand instead of separate
flex-grow
,flex-shrink
, andflex-basis
declarations. We have separated them here as this document is about one of the shorthand components: theflex-basis
property.
pub fn flex_grow_(flex_grow: String) -> Style
The flex-grow
CSS property sets the flex grow factor, which specifies how
much of the flex container’s
positive free space,
if any, should be assigned to the flex item’s
main size.
When the flex-container’s main size is larger than the combined main sizes of its flex items, this positive free space can be distributed among the flex items, with each item’s growth being their growth factor value as a p roportion of the sum total of all the flex items’ flex grow factors.
It is recommended to use the flex shorthand instead of separate
flex-grow
,flex-shrink
, andflex-basis
declarations. We have separated them here as this document is about one of the shorthand components: theflex-basis
property.
pub fn flex_shrink(flex_shrink: Float) -> Style
The flex-shrink
CSS property sets the flex shrink factor of a flex item.
If the size of all flex items is larger than the flex container, the
flex items can shrink
to fit according to their flex-shrink
value. Each flex line’s
negative free space
is distributed between the line’s flex items that have a flex-shrink
value
greater than 0
.
It is recommended to use the flex shorthand instead of separate
flex-grow
,flex-shrink
, andflex-basis
declarations. We have separated them here as this document is about one of the shorthand components: theflex-basis
property.
pub fn flex_shrink_(flex_shrink: String) -> Style
The flex-shrink
CSS property sets the flex shrink factor of a flex item.
If the size of all flex items is larger than the flex container, the
flex items can shrink
to fit according to their flex-shrink
value. Each flex line’s
negative free space
is distributed between the line’s flex items that have a flex-shrink
value
greater than 0
.
It is recommended to use the flex shorthand instead of separate
flex-grow
,flex-shrink
, andflex-basis
declarations. We have separated them here as this document is about one of the shorthand components: theflex-basis
property.
pub fn flex_wrap(flex_wrap: String) -> Style
The flex-wrap
CSS property sets whether flex items are forced onto one
line or can wrap onto multiple lines. If wrapping is allowed, it sets the
direction that lines are stacked.
The flex-flow
property shorthand can be used to set both the
flex-direction
and flex-wrap
properties, which define the flex
container’s main and cross axes, respectively.
pub fn float(float: String) -> Style
The float
CSS property places an element on the left or right side of its
container, allowing text and inline elements to wrap around it. The element
is removed from the normal flow of the page, though still remaining a part
of the flow (in contrast to
absolute positioning).
A floating element is one where the computed value of float
is not none
.
As float
implies the use of the block layout, it modifies the computed value of the display
values, in some cases:
Specified value | Computed value |
---|---|
inline | block |
inline-block | block |
inline-table | table |
table-row | block |
table-row-group | block |
table-column | block |
table-column-group | block |
table-cell | block |
table-caption | block |
table-header-group | block |
table-footer-group | block |
inline-flex | flex |
inline-grid | grid |
other | unchanged |
pub fn focus(styles: List(Style)) -> Style
The :focus
CSS
pseudo-class
represents an element (such as a form input) that has received focus. It is
generally triggered when the user clicks or taps on an element or selects it
with the keyboard’s Tab
key.
pub fn focus_visible(styles: List(Style)) -> Style
The :focus-visible
CSS
pseudo-class
applies while an element matches the :focus
pseudo-class and the User Agent
determines via heuristics that the focus should be made evident on the element.
(Many browsers show a “focus ring” by default in this case.)
pub fn focus_within(styles: List(Style)) -> Style
The :focus-within
CSS
pseudo-class
matches an element if the element or any of its descendants are focused.
In other words, it represents an element that is itself matched by the
:focus
pseudo-class or has a descendant that is matched by :focus
.
(This includes descendants in shadow trees.)
pub fn font(value: String) -> Style
The font
CSS shorthand property sets all the different properties of an
element’s font. Alternatively, it sets an element’s font to a system font.
As with any shorthand property, any individual value that is not specified
is set to its corresponding initial value (possibly overriding values
previously set using non-shorthand properties). Though not directly settable
by font, the longhands font-size-adjust
and font-kerning
are also reset
to their initial values.
This property is a shorthand for the following CSS properties:
pub fn font_face(font_faces: List(FontFace)) -> AtRule
The @font-face
CSS at-rule specifies a custom font with which to display
text; the font can be loaded from either a remote server or a
locally-installed font on the user’s own computer.
pub fn font_family(font_family: String) -> Style
The font-family
CSS property specifies a prioritized list of one or more
font family names and/or generic family names for the selected element.
Values are separated by commas to indicate that they are alternatives. The
browser will select the first font in the list that is installed or that can
be downloaded using a @font-face
at-rule.
It is often convenient to use the shorthand property font
to set
font-size
and other font related properties all at once.
You should always include at least one generic family name in a font-family
list, since there’s no guarantee that any given font is available. This lets
the browser select an acceptable fallback font when necessary.
The font-family
property specifies a list of fonts, from highest priority
to lowest. Font selection does not stop at the first font in the list that
is on the user’s system. Rather, font selection is done one character at a
time, so that if an available font does not have a glyph for a needed
character, the latter fonts are tried. When a font is only available in some
styles, variants, or sizes, those properties may also influence which font
family is chosen.
pub fn font_feature_settings(value: String) -> Style
The font-feature-settings
CSS property controls advanced typographic features
in OpenType fonts.
pub fn font_kerning(value: String) -> Style
The font-kerning
CSS property sets the use of the kerning information stored
in a font.
Kerning defines how letters are spaced. In well-kerned fonts, this feature makes character spacing more uniform and pleasant to read than it would otherwise be.
pub fn font_language_override(value: String) -> Style
The font-language-override
CSS property controls the use of
language-specific glyphs in a typeface.
By default, HTML’s lang
attribute tells browsers to display glyphs designed
specifically for that language. For example, a lot of fonts have a special
character for the digraph fi
that merge the dot on the “i” with the “f.”
However, if the language is set to Turkish the typeface will likely know not
to use the merged glyph; Turkish has two versions of the “i,” one with a dot
(i
) and one without (ı
), and using the ligature would incorrectly
transform a dotted “i” into a dotless “i.”
The font-language-override
property lets you override the typeface behavior
for a specific language. This is useful, for example, when the typeface
you’re using lacks proper support for the language. For instance, if a
typeface doesn’t have proper rules for the Azeri language, you can force the
font to use Turkish glyphs, which follow similar rules.
pub fn font_optical_sizing(value: String) -> Style
The font-optical-sizing
CSS property sets whether text rendering is
optimized for viewing at different sizes.
pub fn font_palette(value: String) -> Style
The font-palette
CSS property allows specifying one of the many palettes
contained in a color font that a user agent
may use for the font. Users can also override the values in a palette or
create a new palette by using the @font-palette-values
at-rule.
A
font-palette
palette takes precedence when coloring a font. Thecolor
property will not override a font palette, even if specified with!important
.
pub fn font_size(font_size: Length) -> Style
The font-size
CSS property sets the size of the font. Changing the font
size also updates the sizes of the font size-relative <length>
units, such
as em
, ex
, and so forth.
pub fn font_size_(font_size: String) -> Style
The font-size
CSS property sets the size of the font. Changing the font
size also updates the sizes of the font size-relative <length>
units, such
as em
, ex
, and so forth.
pub fn font_size_adjust(value: String) -> Style
The font-size-adjust
CSS property provides a way to modify the size of
lowercase letters relative to the size of uppercase letters, which defines
the overall font-size
. This property is useful for situations where font
fallback can occur.
Legibility can become an issue when the first-choice font-family
is
unavailable and its replacement fallback font has a significantly different
aspect value (height of lowercase letters divided by font size). Legibility
of fonts, especially at small font sizes, is determined more by the size of
lowercase letters than by the size of uppercase letters. The font-size-adjust
property is useful for adjusting the font size of fallback fonts to keep the
aspect value across fonts consistent, ensuring that the text appears similar
regardless of the font used.
pub fn font_stretch(value: String) -> Style
The
font-stretch
property has now been renamed tofont-width
in the specifications. The namefont-stretch
has been kept as an alias for thefont-width
property. The new namefont-width
is not yet supported by any browsers.
The font-stretch
CSS property selects a normal, condensed, or expanded
face from a font.
pub fn font_style(font_style: String) -> Style
The font-style
CSS property sets whether a font should be styled with a
normal, italic, or oblique face from its font-family
.
Italic font faces are generally cursive in nature, usually using less
horizontal space than their unstyled counterparts, while oblique faces
are usually just sloped versions of the regular face. When the specified
style is not available, both italic and oblique faces are simulated by
artificially sloping the glyphs of the regular face (use font-synthesis
to control this behavior).
pub fn font_synthesis(value: String) -> Style
The font-synthesis
CSS property is a shorthand property that lets you
specify whether or not the browser may synthesize the bold, italic,
small-caps, and/or subscript and superscript typefaces when they are missing
in the specified font-family.
This property is a shorthand for the following CSS properties:
pub fn font_synthesis_small_caps(value: String) -> Style
The font-synthesis-small-caps
CSS property lets you specify whether or not
the browser may synthesize small-caps typeface when it is missing in a font
family. Small-caps glyphs typically use the form of uppercase letters but are
reduced to the size of lowercase letters.
It is often convenient to use the shorthand property font-synthesis
to
control all typeface synthesis values.
pub fn font_synthesis_style(value: String) -> Style
The font-synthesis-style
CSS property lets you specify whether or not the
browser may synthesize the oblique typeface when it is missing in a font family.
It is often convenient to use the shorthand property font-synthesis
to
control all typeface synthesis values.
pub fn font_synthesis_weight(value: String) -> Style
The font-synthesis-weight
CSS property lets you specify whether or not the
browser may synthesize the bold typeface when it is missing in a font family.
It is often convenient to use the shorthand property font-synthesis
to
control all typeface synthesis values.
pub fn font_variant(value: String) -> Style
The font-variant
CSS shorthand property allows you to set all the font
variants for a font.
You can also set the <font-variant-css2>
values of font-variant
defined
in CSS Level 2.1, (that is, normal
or small-caps
), by using the font
shorthand.
pub fn font_variant_alternates(value: String) -> Style
The font-variant-alternates
CSS property controls the usage of alternate
glyphs. These alternate glyphs may be referenced by alternative names
defined in @font-feature-values
.
The @font-feature-values
at-rule can be used to associate, for a given
font face, a human-readable name with a numeric index that controls a
particular OpenType font feature. For features that select alternative
glyphs (stylistic
, styleset
, character-variant
, swash
, ornament
or annotation
), the font-variant-alternates
property can then reference
the human-readable name in order to apply the associated feature.
This allows CSS rules to enable alternative glyphs without needing to know the specific index values that a particular font uses to control them.
pub fn font_variant_caps(value: String) -> Style
The font-variant-caps
CSS property controls the use of alternate glyphs
used for small or petite capitals or for titling.
When a given font includes capital letter glyphs of multiple different sizes, this property selects the most appropriate ones. If petite capital glyphs are not available, they are rendered using small capital glyphs. If these are not present, the browser synthesizes them from the uppercase glyphs.
Fonts sometimes include special glyphs for various caseless characters (such as punctuation marks) to better match the capitalized characters around them. However, small capital glyphs are never synthesized for caseless characters.
Language-specific rules
This property accounts for language-specific case mapping rules. For example:
- In Turkic languages, such as Turkish (tr), Azerbaijani (az), Crimean Tatar
(crh), Volga Tatar (tt), and Bashkir (ba), there are two kinds of
i
(one with the dot, one without) and two case pairings:i
/İ
andı
/I
. - In German (de), the
ß
may becomeẞ
(U+1E9E) in uppercase. - In Greek (el), vowels lose their accent when the whole word is in uppercase
(
ά
/Α
), except for the disjunctive eta (ή
/Ή
). Also, diphthongs with an accent on the first vowel lose the accent and gain a diacritic on the second vowel (άι
/ΑΪ
).
pub fn font_variant_east_asian(value: String) -> Style
The font-variant-east-asian
CSS property controls the use of alternate
glyphs for East Asian scripts, like Japanese and Chinese.
pub fn font_variant_emoji(value: String) -> Style
The font-variant-emoji
CSS property specifies the default presentation
style for displaying emojis.
Traditionally, this was done by appending a Variation Selector, U+FE0E
for
text and U+FE0F
for emoji, to the emoji code point. Only emojis listed as
contributing to a
Unicode emoji presentation sequence
are affected by this property.
pub fn font_variant_ligatures(value: String) -> Style
The font-variant-ligatures
CSS property controls which ligatures and
contextual forms are used in the textual content of the elements it applies
to. This leads to more harmonized forms in the resulting text.
pub fn font_variant_numeric(value: String) -> Style
The font-variant-numeric
CSS property controls the usage of alternate
glyphs for numbers, fractions, and ordinal markers.
pub fn font_variant_position(value: String) -> Style
The font-variant-position
CSS property controls the use of alternate,
smaller glyphs that are positioned as superscript or subscript.
The glyphs are positioned relative to the baseline of the font, which remains
unchanged. These glyphs are typically used in <sub>
and <sup>
elements.
When the usage of these alternate glyphs is activated, if one character in the run doesn’t have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs.
These alternate glyphs share the same em-box and the same baseline as the rest of the font. They are merely graphically enhanced, and have no effect on the line-height and other box characteristics.
pub fn font_variation_settings(value: String) -> Style
The font-variation-settings
CSS property provides low-level control over
variable font
characteristics by letting you specify the four letter axis names of the
characteristics you want to vary along with their values.
pub fn font_weight(font_weight: String) -> Style
The font-weight
CSS property sets the weight (or boldness) of the font.
The weights available depend on the font-family
that is currently set.
pub fn forced_color_adjust(value: String) -> Style
The forced-color-adjust
CSS property allows authors to opt certain
elements out of forced colors mode. This then restores the control of those
values to CSS.
pub fn fullscreen(styles: List(Style)) -> Style
The :fullscreen
CSS
pseudo-class
matches every element that is currently in fullscreen mode. If multiple
elements have been put into fullscreen mode, this selects them all.
pub fn gap(gap: Length) -> Style
The gap
CSS shorthand property sets the gaps (also called
gutters)
between rows and columns. This property applies to
multi-column,
flex, and
grid containers.
This property is a shorthand for the following CSS properties:
pub fn gap_(gap: String) -> Style
The gap
CSS shorthand property sets the gaps (also called gutters)
between rows and columns. This property applies to
multi-column,
flex, and
grid containers.
This property is a shorthand for the following CSS properties:
pub fn grammar_error(styles: List(Style)) -> Style
The ::grammar-error
CSS
pseudo-element
represents a text segment which the user agent
has flagged as grammatically incorrect.
pub fn grid(value: String) -> Style
The grid
CSS property is a shorthand property that sets all of the
explicit and implicit grid properties in a single declaration.
Using grid
you specify one axis using grid-template-rows
or
grid-template-columns
, you then specify how content should auto-repeat in
the other axis using the implicit grid properties:
grid-auto-rows
, grid-auto-columns
, and grid-auto-flow
.
The sub-properties you don’t specify are set to their initial value, as normal for shorthands. Also, the gutter properties are NOT reset by this shorthand.
This property is a shorthand for the following CSS properties:
grid-auto-columns
grid-auto-flow
grid-auto-rows
grid-template-areas
grid-template-columns
grid-template-rows
pub fn grid_area(grid_area: String) -> Style
The grid-area
CSS shorthand property specifies a grid
item’s size and location within a grid by contributing a line, a span, or
nothing (automatic) to its grid placement, thereby specifying the edges of
its grid area.
If four <grid-line>
values are specified, grid-row-start
is set to the
first value, grid-column-start
is set to the second value, grid-row-end
is set to the third value, and grid-column-end
is set to the fourth value.
When grid-column-end
is omitted, if grid-column-start
is a
<custom-ident>
,
grid-column-end
is set to that <custom-ident>
; otherwise, it is set to auto
.
When grid-row-end
is omitted, if grid-row-start
is a <custom-ident>
,
grid-row-end
is set to that <custom-ident>
; otherwise, it is set to auto
.
When grid-column-start
is omitted, if grid-row-start
is a
<custom-ident>
, all four longhands are set to that value.
Otherwise, it is set to auto
.
The grid-area
property can also be set to a <custom-ident>
which acts as
a name for the area, which can then be placed using grid-template-areas
.
This property is a shorthand for the following CSS properties:
pub fn grid_auto_columns(grid_auto_columns: String) -> Style
The grid-auto-columns
CSS property specifies the size of an
implicitly-created grid column track
or pattern of tracks.
If a grid item is positioned into a column that is not explicitly sized by
grid-template-columns
, implicit grid tracks are created to hold it.
This can happen either by explicitly positioning into a column that is out
of range, or by the auto-placement algorithm creating additional columns.
pub fn grid_auto_flow(grid_auto_flow: String) -> Style
The grid-auto-flow
CSS property controls how the auto-placement algorithm
works, specifying exactly how auto-placed items get flowed into the grid.
pub fn grid_auto_rows(grid_auto_rows: String) -> Style
The grid-auto-rows
CSS property specifies the size of an implicitly-created
grid row track
or pattern of tracks.
If a grid item is positioned into a row that is not explicitly sized by
grid-template-rows
, implicit grid tracks are created to hold it. This can
happen either by explicitly positioning into a row that is out of range, or
by the auto-placement algorithm creating additional rows.
pub fn grid_column(grid_column: String) -> Style
The grid-column
CSS shorthand property specifies a grid item’s size and
location within a grid
column by
contributing a line, a span, or nothing (automatic) to its grid placement,
thereby specifying the inline-start and inline-end edge of its
grid area.
This property is a shorthand for the following CSS properties:
pub fn grid_column_end(grid_column: String) -> Style
The grid-column-end
CSS property specifies a grid item’s end position
within the grid column by contributing a line, a span, or nothing (automatic)
to its grid placement, thereby specifying the block-end edge of its
grid area.
pub fn grid_column_start(grid_column: String) -> Style
The grid-column-start
CSS property specifies a grid item’s start position
within the grid column by contributing a line, a span, or nothing (automatic)
to its grid placement, thereby specifying the block-start edge of its
grid area.
pub fn grid_row(grid_row: String) -> Style
The grid-row
CSS shorthand property specifies a grid item’s size and
location within a grid
row by
contributing a line, a span, or nothing (automatic) to its grid placement,
thereby specifying the inline-start and inline-end edge of its
grid area.
This property is a shorthand for the following CSS properties:
pub fn grid_row_end(grid_row: String) -> Style
The grid-row-end
CSS property specifies a grid item’s end position
within the grid row by contributing a line, a span, or nothing (automatic)
to its grid placement, thereby specifying the inline-end edge of its
grid area.
pub fn grid_row_start(grid_row: String) -> Style
The grid-row-start
CSS property specifies a grid item’s start position
within the grid row by contributing a line, a span, or nothing (automatic)
to its grid placement, thereby specifying the inline-start edge of its
grid area.
pub fn grid_template(grid_template: String) -> Style
The grid-template
CSS property is a shorthand property for defining
grid columns,
grid rows, and
grid areas.
This property is a shorthand for the following CSS properties:
pub fn grid_template_areas(
grid_template_areas: List(String),
) -> Style
The grid-template-areas
CSS property specifies named grid areas,
establishing the cells in the grid and assigning them names.
Those areas are not associated with any particular grid item, but can be
referenced from the grid-placement properties grid-row-start
, grid-row-end
,
grid-column-start
, grid-column-end
, and their shorthands grid-row
,
grid-column
, and grid-area
.
pub fn grid_template_columns(
grid_template_columns: String,
) -> Style
The grid-template-columns
CSS property defines the line names and track
sizing functions of the grid columns.
pub fn grid_template_rows(grid_template_rows: String) -> Style
The grid-template-rows
CSS property defines the line names and track
sizing functions of the grid rows.
pub fn hanging_punctuation(value: String) -> Style
The hanging-punctuation
CSS property specifies whether a punctuation mark
should hang at the start or end of a line of text. Hanging punctuation may
be placed outside the line box.
pub fn height(height: Length) -> Style
The height
CSS property specifies the height of an element. By default,
the property defines the height of the
content area.
If box-sizing
is set to border-box
, however, it instead determines
the height of the border area.
The min-height
and max-height
properties override height
.
As a geometric property,
height
also applies to the<svg>
,<rect>
,<image>
, and<foreignObject>
SVG elements, withauto
resolving to0
and percent values being relative to the SVG viewport height for<rect>
. The CSSheight
property value overrides any SVGheight
attribute value set on the SVG element.
pub fn height_(height: String) -> Style
The height
CSS property specifies the height of an element. By default,
the property defines the height of the
content area.
If box-sizing
is set to border-box
, however, it instead determines
the height of the border area.
The min-height
and max-height
properties override height
.
As a geometric property,
height
also applies to the<svg>
,<rect>
,<image>
, and<foreignObject>
SVG elements, withauto
resolving to0
and percent values being relative to the SVG viewport height for<rect>
. The CSSheight
property value overrides any SVGheight
attribute value set on the SVG element.
pub fn hover(styles: List(Style)) -> Style
The :hover
CSS
pseudo-class
matches when the user interacts with an element with a pointing device,
but does not necessarily activate it. It is generally triggered when the
user hovers over an element with the cursor (mouse pointer).
pub fn hyphenate_character(value: String) -> Style
The hyphenate-character
CSS property sets the character (or string) used
at the end of a line before a hyphenation break.
Both automatic and soft hyphens are displayed according to the specified hyphenate-character value.
pub fn hyphenate_limit_chars(value: String) -> Style
The hyphenate-limit-chars
CSS property specifies the minimum word length to
allow hyphenation of words as well as the minimum number of characters
before and after the hyphen.
This property provides you with fine-grained control over hyphenation in text. This control enables you to avoid awkward hyphenations and set appropriate hyphenation for different languages, which, in turn, allows for better typography.
pub fn hyphens(value: String) -> Style
The hyphens
CSS property specifies how words should be hyphenated when
text wraps across multiple lines. It can prevent hyphenation entirely,
hyphenate at manually-specified points within the text, or let the browser
automatically insert hyphens where appropriate.
Hyphenation rules are language-specific. In HTML, the language is determined
by the lang
attribute, and browsers will hyphenate only if this attribute
is present and the appropriate hyphenation dictionary is available. In XML,
the xml:lang
attribute must be used.
The rules defining how hyphenation is performed are not explicitly defined by the specification, so the exact hyphenation may vary from browser to browser.
If supported, hyphenate-character
may be used to specify an alternative
hyphenation character to use at the end of the line being broken.
pub fn image_orientation(value: String) -> Style
The image-orientation
CSS property specifies a layout-independent
correction to the orientation of an image.
pub fn image_rendering(value: String) -> Style
The image-rendering
CSS property sets an image scaling algorithm. The
property applies to an element itself, to any images set in its other
properties, and to its descendants.
The user agent
will scale an image when the page author specifies dimensions other than its
natural length. Scaling may also occur due to user interaction (zooming). For
example, if the natural size of an image is 100×100px
, but its actual
dimensions are 200×200px
(or 50×50px
), then the image will be upscaled
(or downscaled) using the algorithm specified by image-rendering
. This
property has no effect on non-scaled images.
pub fn important(style: Style) -> Style
Add an !important
flag to any CSS property.
It won’t have any effect on non-property style, like media, etc. It will
then act as the identity
function.
pub fn my_class() {
css.class([
css.background("red"),
css.padding(px(10)) |> css.important,
])
}
Will output
.my_class {
background: red;
padding: 10px !important;
}
pub fn in_range(styles: List(Style)) -> Style
The :in-range
CSS
pseudo-class
represents an <input>
element whose current value is within the range limits specified by the
min
and max
attributes.
pub fn indeterminate(styles: List(Style)) -> Style
The :indeterminate
CSS
pseudo-class
represents any form element whose state is indeterminate, such as checkboxes
that have been set to an indeterminate
state with JavaScript, radio buttons which are members of a group in which
all radio buttons are unchecked, and
<progress>
elements with no value attribute.
pub fn initial_letter(value: String) -> Style
The initial-letter
CSS property sets the size and sink for dropped, raised,
and sunken initial letters. This property applies to ::first-letter
pseudo-elements and inline-level first children of block containers.
pub fn inline_size(value: String) -> Style
The inline-size
CSS property defines the horizontal or vertical size of an
element’s block, depending on its writing mode. It corresponds to either the
width
or the height
property, depending on the value of writing-mode
.
If the writing mode is vertically oriented, the value of inline-size
relates to the height of the element; otherwise, it relates to the width of
the element. A related property is block-size
, which defines the other
dimension of the element.
pub fn inset(value: String) -> Style
The inset
CSS property is a shorthand that corresponds to the top
,
right
, bottom
, and/or left
properties. It has the same multi-value
syntax of the margin
shorthand.
This inset properties,
including inset
, have no effect on non-positioned elements.
While part of the CSS logical properties and values module, it does not define logical offsets. It defines physical offsets, regardless of the element’s writing mode, directionality, and text orientation.
This property is a shorthand for the following CSS properties:
pub fn inset_block(value: String) -> Style
The inset-block
CSS property defines the logical block start and end
offsets of an element, which maps to physical offsets depending on the
element’s writing mode, directionality, and text orientation. It corresponds
to the top
and bottom
, or right
and left
properties depending on the
values defined for writing-mode
, direction
, and text-orientation
.
This inset properties have no effect on non-positioned elements.
This property is a shorthand for the following CSS properties:
pub fn inset_block_end(value: String) -> Style
The inset-block-end
CSS property defines the logical block end offset of
an element, which maps to a physical inset depending on the element’s writing
mode, directionality, and text orientation. It corresponds to the top
,
right
, bottom
, or left
property depending on the values defined for
writing-mode
, direction
, and text-orientation
.
This inset properties have no effect on non-positioned elements.
pub fn inset_block_start(value: String) -> Style
The inset-block-start
CSS property defines the logical block start offset of
an element, which maps to a physical inset depending on the element’s writing
mode, directionality, and text orientation. It corresponds to the top
,
right
, bottom
, or left
property depending on the values defined for
writing-mode
, direction
, and text-orientation
.
This inset properties have no effect on non-positioned elements.
pub fn inset_inline(value: String) -> Style
The inset-inline
CSS property defines the logical start and end offsets of
an element in the inline direction, which maps to physical offsets depending on the
element’s writing mode, directionality, and text orientation. It corresponds
to the top
and bottom
, or right
and left
properties depending on the
values defined for writing-mode
, direction
, and text-orientation
.
This inset properties have no effect on non-positioned elements.
This property is a shorthand for the following CSS properties:
pub fn inset_inline_end(value: String) -> Style
The inset-inline-end
CSS property defines the logical inline end inset of
an element, which maps to a physical inset depending on the element’s writing
mode, directionality, and text orientation. It corresponds to the top
,
right
, bottom
, or left
property depending on the values defined for
writing-mode
, direction
, and text-orientation
.
This inset properties have no effect on non-positioned elements.
pub fn inset_inline_start(value: String) -> Style
The inset-inline-start
CSS property defines the logical inline start inset of
an element, which maps to a physical inset depending on the element’s writing
mode, directionality, and text orientation. It corresponds to the top
,
right
, bottom
, or left
property depending on the values defined for
writing-mode
, direction
, and text-orientation
.
This inset properties have no effect on non-positioned elements.
pub fn invalid(styles: List(Style)) -> Style
The :invalid
CSS
pseudo-class
represents any <form>
,
<fieldset>
,
<input>
or
other <form>
element whose contents fail to [validate].
pub fn isolation(value: String) -> Style
The isolation
CSS property determines whether an element must create a
new stacking context.
This property is especially helpful when used in conjunction with
mix-blend-mode
and z-index
.
pub fn justify_content(justify: String) -> Style
The CSS justify-content
property defines how the browser distributes
space between and around content items along the
main axis
of a flex container and the
inline axis
of grid and multicol containers.
pub fn justify_items(justify: String) -> Style
The CSS justify-items
property defines the default justify-self
for all
items of the box, giving them all a default way of justifying each box along
the appropriate axis.
The effect of this property is dependent of the layout mode we are in:
- In block-level layouts, it aligns the items inside their containing block on the inline axis.
- For absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
- In table cell layouts, this property is ignored (more about alignment in block, absolute positioned and table layout)
- In flexbox layouts, this property is ignored (more about alignment in flexbox)
- In grid layouts, it aligns the items inside their grid areas on the inline axis (more about alignment in grid layouts)
pub fn justify_self(justify: String) -> Style
The CSS justify-self
property sets the way a box is justified inside its
alignment container along the appropriate axis.
The effect of this property is dependent of the layout mode we are in:
- In block-level layouts, it aligns an item inside its containing block on the inline axis.
- For absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
- In table cell layouts, this property is ignored. Read more about alignment in block, absolute positioned and table layout.
- In flexbox layouts, this property is ignored. Read more about alignment in flexbox.
- In grid layouts, it aligns an item inside its grid area on the inline axis. Read more about alignment in grid layouts.
pub fn keyframes(name: String, frames: List(Keyframe)) -> AtRule
The @keyframes CSS at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. This gives more control over the intermediate steps of the animation sequence than transitions.
pub fn last_child(styles: List(Style)) -> Style
The :last-child
CSS
pseudo-class
represents the last element among a group of sibling elements.
pub fn last_of_type(styles: List(Style)) -> Style
The :last-of-type
CSS
pseudo-class
represents the last element of its type among a group of sibling elements.
pub fn left(size: Length) -> Style
The left
CSS property participates in specifying the horizontal position
of a positioned element.
This inset property
has no effect on non-positioned elements.
pub fn left_(size: String) -> Style
The left
CSS property participates in specifying the horizontal position
of a positioned element.
This inset property
has no effect on non-positioned elements.
pub fn letter_spacing(letter_spacing: String) -> Style
The letter-spacing
CSS property sets the horizontal spacing behavior
between text characters. This value is added to the natural spacing between
characters while rendering the text. Positive values of letter-spacing
causes
characters to spread farther apart, while negative values of
letter-spacing
bring characters closer together.
pub fn line_break(line_break: String) -> Style
The line-break
CSS property sets how to break lines of Chinese, Japanese,
or Korean (CJK) text when working with punctuation and symbols.
pub fn line_height(line_height: String) -> Style
The line-height
CSS property sets the height of a line box in horizontal
writing modes.
In vertical writing modes, it sets the width of a line box.
It’s commonly used to set the distance between lines of text. On block-level
elements in horizontal writing modes, it specifies the preferred height of
line boxes within the element, and on non-replaced
inline elements, it specifies the height that is used to calculate line box height.
pub fn link(styles: List(Style)) -> Style
The :link
CSS
pseudo-class
represents an element that has not yet been visited. It matches every unvisited
<a>
or
<area>
element that has an href attribute.
pub fn list_style(list_style: String) -> Style
The list-style
CSS shorthand property allows you to set all the list
style properties at once.
The values of this property are applied to list items, including <li>
elements and elements with display: list-item;
. Because this property is
inherited, it can be set on a parent element (normally <ol>
or <ul>
)
to make the same list styling apply to all the nested items.
This property is a shorthand for the following CSS properties:
pub fn list_style_image(list_style_image: String) -> Style
The list-style-image
CSS property sets an image to be used as the list
item marker.
s
It is often more convenient to use the shorthand list-style
.
This property is applied to list items, i.e. elements with display: list-item;
by default this
includes <li>
elements.
Because this property is inherited, it can be set on a parent element (normally <ol>
or <ul>
)
to let it apply to all list items.
pub fn list_style_position(list_style_position: String) -> Style
The list-style-position
CSS property sets the position of the
::marker
relative to a list item.
pub fn list_style_type(list_style_type: String) -> Style
The list-style-type
CSS property sets the marker (such as a disc,
character, or custom counter style) of a list item element.
The marker will be currentcolor
,
the same as the computed color
of the element it applies to.
Only a few elements (<li>
and <summary>
) have a default value of
display: list-item
. However, the list-style-type
property may be applied
to any element whose display
value is set to list-item
. Moreover,
because this property is inherited, it can be set on a parent element
(commonly <ol>
or <ul>
) to make it apply to all list items.
pub fn margin(margin: Length) -> Style
The margin
CSS shorthand property sets the
margin area
on all four sides of an element.
This property is a shorthand for the following CSS properties:
pub fn margin_(margin: String) -> Style
The margin
CSS shorthand property sets the
margin area
on all four sides of an element.
This property is a shorthand for the following CSS properties:
pub fn margin_block(margin: Length) -> Style
The margin-block
CSS shorthand property defines the logical block start
and end margins of an element, which maps to physical margins depending on
the element’s writing mode, directionality, and text orientation.
This property is a shorthand for the following CSS properties:
pub fn margin_block_(margin: String) -> Style
The margin-block
CSS shorthand property defines the logical block start
and end margins of an element, which maps to physical margins depending on
the element’s writing mode, directionality, and text orientation.
This property is a shorthand for the following CSS properties:
pub fn margin_block_end(margin: Length) -> Style
The margin-block-end
CSS property defines the logical block end margin of
an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation.
pub fn margin_block_end_(margin: String) -> Style
The margin-block-end
CSS property defines the logical block end margin of
an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation.
pub fn margin_block_start(margin: Length) -> Style
The margin-block-start
CSS property defines the logical block start margin of
an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation.
pub fn margin_block_start_(margin: String) -> Style
The margin-block-start
CSS property defines the logical block start margin of
an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation.
pub fn margin_bottom(margin: Length) -> Style
The margin-bottom
CSS property sets the
margin area
on the bottom of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
This property has no effect on non-replaced inline elements, such as <span>
or <code>
.
pub fn margin_bottom_(margin: String) -> Style
The margin-bottom
CSS property sets the
margin area
on the bottom of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
This property has no effect on non-replaced inline elements, such as <span>
or <code>
.
pub fn margin_inline(margin: Length) -> Style
The margin-inline
CSS shorthand property defines both the logical inline
start and end margins of an element, which maps to physical margins depending
on the element’s writing mode, directionality, and text orientation.
This property is a shorthand for the following CSS properties:
pub fn margin_inline_(margin: String) -> Style
The margin-inline
CSS shorthand property defines both the logical inline
start and end margins of an element, which maps to physical margins depending
on the element’s writing mode, directionality, and text orientation.
This property is a shorthand for the following CSS properties:
pub fn margin_inline_end(margin: Length) -> Style
The margin-inline-end
CSS property defines the logical inline end margin
of an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation. In other words, it
corresponds to the margin-top
, margin-right
, margin-bottom
or
margin-left
property depending on the values defined for writing-mode
,
direction
, and text-orientation
.
pub fn margin_inline_end_(margin: String) -> Style
The margin-inline-end
CSS property defines the logical inline end margin
of an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation. In other words, it
corresponds to the margin-top
, margin-right
, margin-bottom
or
margin-left
property depending on the values defined for writing-mode
,
direction
, and text-orientation
.
pub fn margin_inline_start(margin: Length) -> Style
The margin-inline-start
CSS property defines the logical inline start margin
of an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation. In other words, it
corresponds to the margin-top
, margin-right
, margin-bottom
or
margin-left
property depending on the values defined for writing-mode
,
direction
, and text-orientation
.
pub fn margin_inline_start_(margin: String) -> Style
The margin-inline-start
CSS property defines the logical inline start margin
of an element, which maps to a physical margin depending on the element’s
writing mode, directionality, and text orientation. In other words, it
corresponds to the margin-top
, margin-right
, margin-bottom
or
margin-left
property depending on the values defined for writing-mode
,
direction
, and text-orientation
.
pub fn margin_left(margin: Length) -> Style
The margin-left
CSS property sets the
margin area
on the left of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
The vertical margins of two adjacent boxes may fuse. This is called margin collapsing.
In the rare cases where width is overconstrained (i.e., when all of width
,
margin-left
, border
, padding
, the content area, and margin-right
are
defined), margin-left
is ignored, and will have the same calculated value
as if the auto
value was specified.
pub fn margin_left_(margin: String) -> Style
The margin-left
CSS property sets the
margin area
on the left of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
The vertical margins of two adjacent boxes may fuse. This is called margin collapsing.
In the rare cases where width is overconstrained (i.e., when all of width
,
margin-left
, border
, padding
, the content area, and margin-right
are
defined), margin-left
is ignored, and will have the same calculated value
as if the auto
value was specified.
pub fn margin_right(margin: Length) -> Style
The margin-right
CSS property sets the
margin area
on the right of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
The vertical margins of two adjacent boxes may fuse. This is called margin collapsing.
pub fn margin_right_(margin: String) -> Style
The margin-right
CSS property sets the
margin area
on the right of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
The vertical margins of two adjacent boxes may fuse. This is called margin collapsing.
pub fn margin_top(margin: Length) -> Style
The margin-top
CSS property sets the
margin area
on the top of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
This property has no effect on non-replaced inline elements, such as <span>
or <code>
.
pub fn margin_top_(margin: String) -> Style
The margin-top
CSS property sets the
margin area
on the top of an element. A positive value places it farther from its
neighbors, while a negative value places it closer.
This property has no effect on non-replaced inline elements, such as <span>
or <code>
.
pub fn marker(styles: List(Style)) -> Style
The ::marker
CSS
pseudo-element
selects the marker box of a list item, which typically contains a bullet or
number. It works on any element or pseudo-element set to
display: list-item
,
such as the <li>
and
<summary>
elements.
pub fn mask(value: String) -> Style
The mask
CSS shorthand property hides an element (partially or fully) by
masking or clipping the image at specific points.
As well as the properties listed below, the
mask
shorthand also resetsmask-border
to its initial value. It is therefore recommended to use themask
shorthand rather than other shorthands or the individual properties to override any mask settings earlier in the cascade. This will ensure thatmask-border
has also been reset to allow the new styles to take effect.
This property is a shorthand for the following CSS properties:
pub fn mask_border(value: String) -> Style
The mask-border
CSS shorthand property lets you create a mask along the
edge of an element’s border.
This property is a shorthand for the following CSS properties:
mask-border-mode
mask-border-outset
mask-border-repeat
mask-border-slice
mask-border-source
mask-border-width
pub fn mask_border_mode(value: String) -> Style
pub fn mask_border_outset(value: String) -> Style
The mask-border-outset
CSS property specifies the distance by which an element’s
mask border
is set out from its border box.
pub fn mask_border_repeat(value: String) -> Style
The mask-border-repeat
CSS property sets how the
edge regions
of a source image are adjusted to fit the dimensions of an element’s
mask border.
pub fn mask_border_slice(value: String) -> Style
The mask-border-slice
CSS property divides the image set by
mask-border-source
into regions. These regions are used to form the
components of an element’s mask
mask border.
pub fn mask_border_source(value: String) -> Style
The mask-border-source
CSS property sets the source image used to create
an element’s
mask border.
The mask-border-slice
property is used to divide the source image into
regions, which are then dynamically applied to the final mask border.
pub fn mask_border_width(value: Length) -> Style
pub fn mask_border_width_(value: String) -> Style
pub fn mask_clip(value: String) -> Style
The mask-clip
CSS property determines the area which is affected by a mask.
The painted content of an element must be restricted to this area.
pub fn mask_composite(value: String) -> Style
The mask-composite
CSS property represents a compositing operation used
on the current mask layer with the mask layers below it.
pub fn mask_image(value: String) -> Style
The mask-image
CSS property sets the image that is used as mask layer for
an element. By default this means the alpha channel of the mask image will be
multiplied with the alpha channel of the element. This can be controlled
with the mask-mode
property.
pub fn mask_mode(value: String) -> Style
The mask-mode
CSS property sets whether the mask reference defined by
mask-image
is treated as a luminance or alpha mask.
pub fn mask_origin(value: String) -> Style
The mask-origin
CSS property sets the origin of a mask.
For elements rendered as a single box, this property specifies the mask
positioning area. In other words, this property specifies the origin
position of an image specified by the mask-image
CSS property. For
elements rendered as multiple boxes, such as inline boxes on several lines
or boxes on several pages, it specifies which boxes box-decoration-break
operates upon to determine the mask positioning area.
pub fn mask_position(value: String) -> Style
The mask-position
CSS property sets the initial position, relative to the
mask position layer set by mask-origin
, for each defined mask image.
pub fn mask_repeat(value: String) -> Style
The mask-repeat
CSS property sets how mask images are repeated. A mask
image can be repeated along the horizontal axis, the vertical axis, both
axes, or not repeated at all.
By default, the repeated images are clipped to the size of the element, but
they can be scaled to fit (using round
) or evenly distributed from end to
end (using space
).
pub fn mask_size(value: String) -> Style
The mask-size
CSS property specifies the sizes of the mask images. The
size of the image can be fully or partially constrained in order to
preserve its intrinsic ratio.
If the value of this property is not set in a
mask
shorthand property that is applied to the element after themask-size
CSS property, the value of this property is then reset to its initial value by the shorthand property.
pub fn mask_type(value: String) -> Style
The mask-type
CSS property sets whether an SVG <mask>
element is used as
a luminance or an alpha mask. It applies to the <mask>
element itself.
This property may be overridden by the mask-mode
property, which has the
same effect but applies to the element where the mask is used. Alpha masks
will generally be faster to render.
pub fn math_depth(value: String) -> Style
The math-depth
property describes a notion of depth for each element of a
mathematical formula, with respect to the top-level container of that
formula. This is used to scale the computed value of the font-size of
elements when font-size: math
is applied.
font-size: math
is the default for<math>
elements in the MathML Core User Agent stylesheet, so it’s not necessary to specify it explicitly.
pub fn math_style(value: String) -> Style
The math-style
property indicates whether MathML equations should render
with normal or compact height.
pub fn max_block_size(value: Length) -> Style
The max-block-size
CSS property specifies the maximum size of an element
in the direction opposite that of the writing direction as specified by
writing-mode
. That is, if the writing direction is horizontal, then
max-block-size
is equivalent to max-height
; if the writing direction is
vertical, max-block-size
is the same as max-width
.
The other dimension’s maximum length is specified using the
max-inline-size
property.
This is useful because the max-width
is always used for horizontal sizes
and max-height
is always used for vertical sizes, and if you need to set
lengths based on the size of your text content, you need to be able to do
so with the writing direction in mind.
Any time you would normally use max-height
or max-width
, you should
instead use max-block-size
to set the maximum “height” of the content
(even though this may not be a vertical value) and max-inline-size
to set
the maximum “width” of the content (although this may instead be vertical
rather than horizontal).
See writing-mode
examples,
which show the different writing modes in action.
pub fn max_block_size_(value: String) -> Style
The max-block-size
CSS property specifies the maximum size of an element
in the direction opposite that of the writing direction as specified by
writing-mode
. That is, if the writing direction is horizontal, then
max-block-size
is equivalent to max-height
; if the writing direction is
vertical, max-block-size
is the same as max-width
.
The other dimension’s maximum length is specified using the
max-inline-size
property.
This is useful because the max-width
is always used for horizontal sizes
and max-height
is always used for vertical sizes, and if you need to set
lengths based on the size of your text content, you need to be able to do
so with the writing direction in mind.
Any time you would normally use max-height
or max-width
, you should
instead use max-block-size
to set the maximum “height” of the content
(even though this may not be a vertical value) and max-inline-size
to set
the maximum “width” of the content (although this may instead be vertical
rather than horizontal).
See writing-mode
examples,
which show the different writing modes in action.
pub fn max_height(height: Length) -> Style
The max-height
CSS property sets the maximum height of an element. It
prevents the used value
of the height
property from becoming larger than the value specified for max-height
.
max-height
overrides height
, but min-height
overrides max-height
.
pub fn max_height_(height: String) -> Style
The max-height
CSS property sets the maximum height of an element. It
prevents the used value
of the height
property from becoming larger than the value specified for max-height
.
max-height
overrides height
, but min-height
overrides max-height
.
pub fn max_inline_size(value: Length) -> Style
The max-inline-size
CSS property defines the horizontal or vertical
maximum size of an element’s block, depending on its writing mode. It
corresponds to either the max-width
or the max-height
property,
depending on the value of writing-mode
.
If the writing mode is vertically oriented, the value of max-inline-size
relates to the maximal height of the element; otherwise, it relates to the
maximal width of the element. A related property is max-block-size
, which
defines the other dimension of the element.
pub fn max_inline_size_(value: String) -> Style
The max-inline-size
CSS property defines the horizontal or vertical
maximum size of an element’s block, depending on its writing mode. It
corresponds to either the max-width
or the max-height
property,
depending on the value of writing-mode
.
If the writing mode is vertically oriented, the value of max-inline-size
relates to the maximal height of the element; otherwise, it relates to the
maximal width of the element. A related property is max-block-size
, which
defines the other dimension of the element.
pub fn max_width(width: Length) -> Style
The max-width
CSS property sets the maximum width of an element. It
prevents the used value
of the width
property from becoming larger than the value specified by
max-width
.
max-width
overrides width
, but min-width
overrides max-width
.
pub fn max_width_(width: String) -> Style
The max-width
CSS property sets the maximum width of an element. It
prevents the used value
of the width
property from becoming larger than the value specified by
max-width
.
max-width
overrides width
, but min-width
overrides max-width
.
pub fn media(query: Query, styles: List(Style)) -> Style
Allows to write inline media queries in classes. Contrarily to inline CSS where media queries can’t be used, Sketch generates CSS all the way to ensure media queries are usable.
Media queries allow you to apply CSS styles depending on a device’s media type (such as print vs. screen) or other features or characteristics such as screen resolution or orientation, aspect ratio, browser viewport width or height, user preferences such as preferring reduced motion, data usage, or transparency.
pub fn my_class() {
css.class([
css.background("blue"),
css.media(media.max_width(px(700)), [
css.background("red"),
]),
])
}
pub fn min_block_size(value: Length) -> Style
The min-block-size
CSS property defines the minimum horizontal or vertical
size of an element’s block, depending on its writing mode. It corresponds to
either the min-width
or the min-height
property, depending on the value
of writing-mode
.
If the writing mode is vertically oriented, the value of min-block-size
relates to the minimum width of the element; otherwise, it relates to the
minimum height of the element. A related property is min-inline-size
,
which defines the other dimension of the element.
pub fn min_block_size_(value: String) -> Style
The min-block-size
CSS property defines the minimum horizontal or vertical
size of an element’s block, depending on its writing mode. It corresponds to
either the min-width
or the min-height
property, depending on the value
of writing-mode
.
If the writing mode is vertically oriented, the value of min-block-size
relates to the minimum width of the element; otherwise, it relates to the
minimum height of the element. A related property is min-inline-size
,
which defines the other dimension of the element.
pub fn min_height(height: Length) -> Style
The min-height
CSS property sets the minimum height of an element. It
prevents the used value
of the height
property from becoming smaller than the value specified for
min-height
.
The element’s height is set to the value of min-height
whenever
min-height
is larger than max-height
or height
.
pub fn min_height_(height: String) -> Style
The min-height
CSS property sets the minimum height of an element. It
prevents the used value
of the height
property from becoming smaller than the value specified for
min-height
.
The element’s height is set to the value of min-height
whenever
min-height
is larger than max-height
or height
.
pub fn min_inline_size(value: Length) -> Style
The min-inline-size
CSS property defines the horizontal or vertical
minimal size of an element’s block, depending on its writing mode. It
corresponds to either the min-width
or the min-height
property,
depending on the value of writing-mode
.
pub fn min_inline_size_(value: String) -> Style
The min-inline-size
CSS property defines the horizontal or vertical
minimal size of an element’s block, depending on its writing mode. It
corresponds to either the min-width
or the min-height
property,
depending on the value of writing-mode
.
pub fn min_width(width: Length) -> Style
The min-width
CSS property sets the minimum width of an element. It
prevents the used value
of the width
property from becoming smaller than the value specified for
min-width
.
The element’s width is set to the value of min-width
whenever
min-width
is larger than max-width
or width
.
pub fn min_width_(width: String) -> Style
The min-width
CSS property sets the minimum width of an element. It
prevents the used value
of the width
property from becoming smaller than the value specified for
min-width
.
The element’s width is set to the value of min-width
whenever
min-width
is larger than max-width
or width
.
pub fn mix_blend_mode(value: String) -> Style
The mix-blend-mode
CSS property sets how an element’s content should blend
with the content of the element’s parent and the element’s background.
pub fn muted(styles: List(Style)) -> Style
The :muted
CSS
pseudo-class
selector represents an element that is capable of making sound, such as
<audio>
or <video>
,
but is muted (forced silent).
Muted is different from :volume-locked
in that the page author has control over whether a media element can be
muted or un-muted. User agents may set media muted
value according to use
preferences (e.g., remembering the last set value across sessions, on a
per-site basis, or otherwise). An element that is :volume-locked
cannot
be muted, un-muted, or have its volume changed via JavaScript because of an
operating system or user agent preference.
pub fn next_sibling(class: Class, styles: List(Style)) -> Style
The next-sibling combinator (+
) separates two selectors and matches the
second element only if it immediately follows the first element, and both
are children of the same parent element.
/* Paragraphs that come immediately after any image */
img + p {
font-weight: bold;
}
pub fn none() -> Style
Use it to avoid generating a property. Can be used to generate dynamic classes, or when an empty property is needed.
pub fn my_class(is_blue: Bool) {
css.class([
case is_blue {
True -> css.background("blue")
False -> css.none()
}
])
}
pub fn nth_child(sel: String, styles: List(Style)) -> Style
The :nth-child()
CSS
pseudo-class
matches elements based on the indexes of the elements in the child list of
their parents. In other words, the :nth-child()
selector selects child
elements according to their position among all the sibling elements
within a parent element.
pub fn nth_last_child(sel: String, styles: List(Style)) -> Style
The :nth-last-child()
CSS
pseudo-class
matches elements based on their position among a group of siblings, counting
from the end.
pub fn nth_last_of_type(
sel: String,
styles: List(Style),
) -> Style
The :nth-last-of-type()
CSS
pseudo-class
matches elements based on their position among siblings of the same type
(tag name), counting from the end.
pub fn nth_of_type(sel: String, styles: List(Style)) -> Style
The :nth-of-type()
CSS
pseudo-class
matches elements based on their position among siblings of the same type
(tag name).
pub fn object_fit(object_fit: String) -> Style
The object-fit
CSS property sets how the content of a
replaced element,
such as an <img>
or <video>
, should be resized to fit its container.
The
object-fit
property has no effect on<iframe>
,<embed>
, and<fencedframe>
elements.
You can alter the alignment of the replaced element’s content object within
the element’s box using the object-position
property.
pub fn object_position(object_position: String) -> Style
The object-position
CSS property specifies the alignment of the selected
replaced element’s
contents within the element’s box. Areas of the box which aren’t covered by
the replaced element’s object will show the element’s background.
You can adjust how the replaced element’s object’s intrinsic size (that is,
its natural size) is adjusted to fit within the element’s box using the
object-fit
property.
pub fn offset(offset: String) -> Style
The offset
CSS shorthand property sets all the properties required for
animating an element along a defined path. The offset properties together
help to define an offset transform, a
transform
that aligns a point in an element (offset-anchor
) to an offset position
(offset-position
) on a path (offset-path
) at various points along the
path (offset-distance
) and optionally rotates the element (offset-rotate
)
to follow the direction of the path.
This property is a shorthand for the following CSS properties:
pub fn offset_anchor(offset_anchor: String) -> Style
The offset-anchor
CSS property specifies the point inside the box of an
element traveling along an offset-path
that is actually moving along
the path.
pub fn offset_distance(offset_distance: String) -> Style
The offset-distance
CSS property specifies a position along an
offset-path
for an element to be placed.
pub fn offset_path(offset_path: String) -> Style
The offset-path
CSS property specifies a path for an element to follow and
determines the element’s positioning within the path’s parent container or
the SVG coordinate system. The path is a line, a curve, or a geometrical
shape along which the element gets positioned or moves.
The offset-path
property is used in combination with the offset-distance
,
offset-rotate
, and offset-anchor
properties to control the position and
orientation of the element along a path.
pub fn offset_position(offset_position: String) -> Style
The offset-position
CSS property defines the initial position of an
element along a path. This property is typically used in combination with
the offset-path
property to create a motion effect. The value of
offset-position
determines where the element gets placed initially for
moving along an offset path if an offset-path
function such as path()
does not specify its own starting position.
The offset-position
property is part of a motion system based on offset
constituent properties, including offset-anchor
, offset-distance
, and
offset-path
. These properties work together to create various motion
effects along a path.
pub fn offset_rotate(offset_rotate: String) -> Style
The offset-rotate
CSS property defines the orientation/direction of the
element as it is positioned along the offset-path
.
pub fn only_child(styles: List(Style)) -> Style
The :only-child
CSS
pseudo-class
represents an element without any siblings. This is the same as
:first-child:last-child
or :nth-child(1):nth-last-child(1)
,
but with a lower specificity.
pub fn only_of_type(styles: List(Style)) -> Style
The :only-of-type
CSS
pseudo-class
represents an element that has no siblings of the same type.
pub fn opacity(opacity: Float) -> Style
The opacity
CSS property sets the opacity of an element. Opacity is the
degree to which content behind an element is hidden, and is the opposite of
transparency.
pub fn optional(styles: List(Style)) -> Style
The :optional
CSS
pseudo-class
represents any <input>
,
<select>
or
<textarea>
element that has the optional
attribute set on it.
pub fn order(value: Int) -> Style
The order
CSS property sets the order to lay out an item in a flex or
grid container. Items in a container are sorted by ascending order
value
and then by their source code order. Items not given an explicit order
value are assigned the default value of 0
.
pub fn order_(value: String) -> Style
The order
CSS property sets the order to lay out an item in a flex or
grid container. Items in a container are sorted by ascending order
value
and then by their source code order. Items not given an explicit order
value are assigned the default value of 0
.
pub fn orphans(value: Int) -> Style
pub fn orphans_(value: String) -> Style
pub fn out_of_range(styles: List(Style)) -> Style
The :out-of-range
CSS
pseudo-class
represents an <input>
element whose current value is outside the range limits specified by the
min
and max
attributes.
pub fn outline(outline: String) -> Style
The outline
CSS shorthand property sets most of the outline properties in
a single declaration.
This property is a shorthand for the following CSS properties:
pub fn outline_color(outline_color: String) -> Style
The outline-color
CSS property sets the color of an element’s outline.
It is often more convenient to use the shorthand property outline
when
defining the appearance of an outline.
pub fn outline_offset(outline_offset: String) -> Style
The outline-offset
CSS property sets the amount of space between an
outline and the edge or border of an element.
pub fn outline_style(outline_style: String) -> Style
The outline-style
CSS property sets the style of an element’s outline.
An outline is a line that is drawn around an element, outside the border
.
It is often more convenient to use the shorthand property outline
when
defining the appearance of an outline.
pub fn outline_width(outline_width: String) -> Style
The outline-width
CSS property sets the thickness of an element’s outline.
An outline is a line that is drawn around an element, outside the border
.
It is often more convenient to use the shorthand property outline
when
defining the appearance of an outline.
pub fn overflow(overflow: String) -> Style
The overflow
CSS shorthand property sets the desired behavior when content
does not fit in the element’s padding box (overflows) in the horizontal
and/or vertical direction.
This property is a shorthand for the following CSS properties:
pub fn overflow_anchor(overflow_anchor: String) -> Style
The overflow-anchor
CSS property provides a way to opt out of the
browser’s scroll anchoring behavior, which adjusts scroll position to
minimize content shifts.
Scroll anchoring behavior is enabled by default in any browser that supports it. Therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off.
pub fn overflow_block(overflow_block: String) -> Style
The overflow-block CSS property sets what shows when content overflows the block start and block end edges of a box. This may be nothing, a scroll bar, or the overflow content.
The
overflow-block
property maps tooverflow-y
oroverflow-x
depending on the writing mode of the document.
pub fn overflow_clip_margin(
overflow_clip_margin: String,
) -> Style
The overflow-clip-margin
CSS property determines how far outside its
bounds an element with overflow: clip
may be painted before being clipped.
The bound defined by this property is called the overflow clip edge of
the box.
pub fn overflow_inline(overflow_inline: String) -> Style
The overflow-inline
CSS property sets what shows when content overflows
the inline start and end edges of a box. This may be nothing, a scroll bar,
or the overflow content.
The
overflow-inline
property maps tooverflow-y
oroverflow-x
depending on the writing mode of the document.
pub fn overflow_wrap(overflow_wrap: String) -> Style
The overflow-wrap
CSS property applies to text, setting whether the
browser should insert line breaks within an otherwise unbreakable string to
prevent text from overflowing its line box.
The property was originally a nonstandard and unprefixed Microsoft extension called
word-wrap
, and was implemented by most browsers with the same name. It has since been renamed tooverflow-wrap
, withword-wrap
being an alias.
pub fn overflow_x(overflow_x: String) -> Style
The overflow-x
CSS property sets what shows when content overflows a
block-level element’s left and right edges. This may be nothing, a scroll
bar, or the overflow content. This property may also be set by using the
overflow
shorthand property.
pub fn overflow_y(overflow_y: String) -> Style
The overflow-y
CSS property sets what shows when content overflows a
block-level element’s top and bottom edges. This may be nothing, a scroll
bar, or the overflow content. This property may also be set by using the
overflow
shorthand property.
pub fn overscroll_behavior(value: String) -> Style
The overscroll-behavior
CSS property sets what a browser does when
reaching the boundary of a scrolling area.
This property is a shorthand for the following CSS properties:
pub fn overscroll_behavior_block(value: String) -> Style
The overscroll-behavior-block
CSS property sets the browser’s behavior
when the block direction boundary of a scrolling area is reached.
pub fn overscroll_behavior_inline(value: String) -> Style
The overscroll-behavior-inline
CSS property sets the browser’s behavior
when the inline direction boundary of a scrolling area is reached.
pub fn overscroll_behavior_x(value: String) -> Style
The overscroll-behavior-x
CSS property sets the browser’s behavior when
the horizontal boundary of a scrolling area is reached.
pub fn overscroll_behavior_y(value: String) -> Style
The overscroll-behavior-x
CSS property sets the browser’s behavior when
the vertical boundary of a scrolling area is reached.
pub fn padding(padding: Length) -> Style
The padding
CSS shorthand property sets the
padding area
on all four sides of an element at once.
An element’s padding area is the space between its content and its border.
Padding creates extra space within an element. In contrast, margin creates extra space around an element.
This property is a shorthand for the following CSS properties:
pub fn padding_(padding: String) -> Style
The padding
CSS shorthand property sets the
padding area
on all four sides of an element at once.
An element’s padding area is the space between its content and its border.
Padding creates extra space within an element. In contrast, margin creates extra space around an element.
This property is a shorthand for the following CSS properties:
pub fn padding_block(padding: Length) -> Style
The padding-block
CSS shorthand property defines the logical block start
and end padding of an element, which maps to physical padding properties
depending on the element’s writing mode, directionality, and
text orientation.
This property is a shorthand for the following CSS properties:
pub fn padding_block_(padding: String) -> Style
The padding-block
CSS shorthand property defines the logical block start
and end padding of an element, which maps to physical padding properties
depending on the element’s writing mode, directionality, and
text orientation.
This property is a shorthand for the following CSS properties:
pub fn padding_block_end(padding: Length) -> Style
The padding-block-end
CSS property defines the logical block end padding
of an element, which maps to a physical padding depending on the element’s
writing mode, directionality, and text orientation.
pub fn padding_block_end_(padding: String) -> Style
The padding-block-end
CSS property defines the logical block end padding
of an element, which maps to a physical padding depending on the element’s
writing mode, directionality, and text orientation.
pub fn padding_block_start(padding: Length) -> Style
The padding-block-start
CSS property defines the logical block start padding
of an element, which maps to a physical padding depending on the element’s
writing mode, directionality, and text orientation.
pub fn padding_block_start_(padding: String) -> Style
The padding-block-start
CSS property defines the logical block start padding
of an element, which maps to a physical padding depending on the element’s
writing mode, directionality, and text orientation.
pub fn padding_bottom(padding: Length) -> Style
The padding-bottom
CSS property sets the height of the padding area on
the bottom of an element.
pub fn padding_bottom_(padding: String) -> Style
The padding-bottom
CSS property sets the height of the padding area on
the bottom of an element.
pub fn padding_inline(padding: Length) -> Style
The padding-inline
CSS shorthand property defines the logical inline start
and end padding of an element, which maps to physical padding properties
depending on the element’s writing mode, directionality, and
text orientation.
This property is a shorthand for the following CSS properties:
pub fn padding_inline_(padding: String) -> Style
The padding-inline
CSS shorthand property defines the logical inline start
and end padding of an element, which maps to physical padding properties
depending on the element’s writing mode, directionality, and
text orientation.
This property is a shorthand for the following CSS properties:
pub fn padding_inline_end(padding: Length) -> Style
The padding-inline-end
CSS property defines the logical inline end
padding of an element, which maps to a physical padding depending on the
element’s writing mode, directionality, and text orientation.
pub fn padding_inline_end_(padding: String) -> Style
The padding-inline-end
CSS property defines the logical inline end
padding of an element, which maps to a physical padding depending on the
element’s writing mode, directionality, and text orientation.
pub fn padding_inline_start(padding: Length) -> Style
The padding-inline-start
CSS property defines the logical inline start
padding of an element, which maps to a physical padding depending on the
element’s writing mode, directionality, and text orientation.
pub fn padding_inline_start_(padding: String) -> Style
The padding-inline-start
CSS property defines the logical inline start
padding of an element, which maps to a physical padding depending on the
element’s writing mode, directionality, and text orientation.
pub fn padding_left(padding: Length) -> Style
The padding-left
CSS property sets the width of the padding area to
the left of an element.
pub fn padding_left_(padding: String) -> Style
The padding-left
CSS property sets the width of the padding area to
the left of an element.
pub fn padding_right(padding: Length) -> Style
The padding-right
CSS property sets the width of the padding area to
the right of an element.
pub fn padding_right_(padding: String) -> Style
The padding-right
CSS property sets the width of the padding area to
the right of an element.
pub fn padding_top(padding: Length) -> Style
The padding-top
CSS property sets the height of the padding area on the
top of an element.
pub fn padding_top_(padding: String) -> Style
The padding-top
CSS property sets the height of the padding area on the
top of an element.
pub fn page(value: String) -> Style
The page
CSS property is used to specify the named page, a specific
type of page defined by the @page
at-rule.
If there are multiple selectors that are using a named page consecutively
then a forced page break using break-after
may be needed.
pub fn paint_order(value: String) -> Style
The paint-order
CSS property lets you control the order in which the fill
and stroke (and painting markers) of text content and shapes are drawn.
pub fn paused(styles: List(Style)) -> Style
The :paused
CSS
pseudo-class
selector represents an element that is playable, such as
<audio>
or
<video>
,
when that element is “paused” (i.e. not “playing”).
A resource is paused if the user explicitly paused it, or if it is in a
non-activated or other non-playing state, like “loaded, hasn’t been activated yet”.
This is different from :buffering
or :stalled
, which are states that
occur while the resource is considered “playing”.
pub fn perspective(value: String) -> Style
The perspective
CSS property determines the distance between the z=0
plane and the user in order to give a 3D-positioned element some
perspective.
pub fn perspective_origin(value: String) -> Style
The perspective-origin
CSS property determines the position at which the
viewer is looking. It is used as the vanishing point by the
perspective property.
pub fn place_content(place: String) -> Style
pub fn place_items(place: String) -> Style
The CSS place-items
shorthand property aligns items along both the block
and inline directions at once. It sets the values of the align-items
and
justify-items
properties. If the second value is not set, the first
value is also used for it.
This property is a shorthand for the following CSS properties:
pub fn place_self(place: String) -> Style
The place-self
CSS shorthand property allows you to align an individual
item in both the block and inline directions at once (i.e. the align-self
and justify-self
properties). This property applies to block-level boxes,
absolutely-positioned boxes, and grid items. If the second value is not
present, the first value is also used for it.
This property is a shorthand for the following CSS properties:
pub fn placeholder(styles: List(Style)) -> Style
The ::placeholder
CSS
pseudo-element represents the
placeholder text in an
<input>
or
<textarea>
element.
pub fn placeholder_shown(styles: List(Style)) -> Style
The :placeholder-shown
CSS
pseudo-class
represents any <input>
or <textarea>
element that is currently
displaying placeholder text.
pub fn playing(styles: List(Style)) -> Style
The :playing
CSS
pseudo-class
selector represents the playback state of an element that is playable, such as
<audio>
or
<video>
,
when that element is “playing”. An element is considered to be playing if
it is currently playing the media resource, or if it has temporarily stopped
for reasons other than user intent (such as :buffering
or :stalled
).
pub fn pointer_events(pointer_events: String) -> Style
The pointer-events
CSS property sets under what circumstances (if any)
a particular graphic element can become the target of pointer events.
pub fn position(position: String) -> Style
The position
CSS property sets how an element is positioned in a document.
The top
, right
, bottom
, and left
properties determine the final
location of positioned elements.
pub fn print_color_adjust(print: String) -> Style
The print-color-adjust
CSS property sets what, if anything, the
user agent
may do to optimize the appearance of the element on the output device. By
default, the browser is allowed to make any adjustments to the element’s
appearance it determines to be necessary and prudent given the type and
capabilities of the output device.
pub fn property(field: String, content: String) -> Style
Write the arbitrary property you need. Sometimes, an unsupported property is needed, maybe because it’s prefixed, maybe because it’s too recent, maybe because it’s still experimental.
pub fn my_class() {
css.class([
css.background("blue"),
css.property("-webkit-line-clamp", "3"),
])
}
pub fn quotes(quotes: String) -> Style
The CSS quotes
property sets how the browser should render quotation marks
that are automatically added to the HTML <q>
element or added using the
open-quotes
or close-quotes
(or omitted using the no-open-quote
and
no-close-quote
) values of the of the CSS content
property.
Browsers insert quotation marks at the opening and closing of <q>
elements
and for the open-quote
and close-quote
values of the content
property.
Each opening or closing quote is replaced by one of the strings from the
value of quotes
, based on the depth of nesting, or, if quotes
is
explicitly set to or otherwise resolves to auto
, the quotation marks used
are language dependent.
pub fn read_only(styles: List(Style)) -> Style
The :read-only
CSS
pseudo-class
selects elements (such as certain <input>
types and <textarea>
)
that are not editable by the user. Elements on which the HTML attribute
readonly doesn’t have an effect (such as
<input type="radio">
,
<input type="checkbox">
,
and all other non-form elements) are also selected by the :read-only
pseudo-class. In fact, :read-only
matches anything that :read-write
doesn’t match, making it equivalent to :not(:read-write)
.
pub fn read_write(styles: List(Style)) -> Style
The :read-write
CSS
pseudo-class
represents an element (such as <input>
or <textarea>
)
that is editable by the user.
pub fn required(styles: List(Style)) -> Style
The :required
CSS
pseudo-class
represents any <input>
,
<select>
or
<textarea>
element that has the required
attribute set on it.
pub fn resize(value: String) -> Style
The resize
CSS property sets whether an element is resizable, and if so,
in which directions.
resize
does not apply to the following:
- Inline elements
- Block elements for which the
overflow
property is set tovisible
orclip
pub fn right(size: Length) -> Style
The right
CSS property participates in specifying the horizontal position
of a positioned element.
This inset property
has no effect on non-positioned elements.
pub fn right_(size: String) -> Style
The right
CSS property participates in specifying the horizontal position
of a positioned element.
This inset property
has no effect on non-positioned elements.
pub fn rotate(value: String) -> Style
The rotate
CSS property allows you to specify rotation transforms
individually and independently of the transform
property. This maps
better to typical user interface usage, and saves having to remember the
exact order of transform functions to specify in the transform
property.
pub fn row_gap(row_gap: Length) -> Style
The row-gap
CSS property sets the size of the gap
(gutter)
between an element’s rows.
Early versions of the specification called this property grid-row-gap
,
and to maintain compatibility with legacy websites, browsers will still
accept grid-row-gap
as an alias for row-gap
.
pub fn ruby_align(value: String) -> Style
The ruby-align
CSS property defines the distribution of the different
ruby elements over the base.
pub fn ruby_position(value: String) -> Style
The ruby-position
CSS property defines the position of a ruby element
relative to its base element. It can be positioned over the element
(over
), under it (under
), or between the characters on their right
side (inter-character
).
pub fn scale(value: String) -> Style
The scale
CSS property allows you to specify scale transforms i
ndividually and independently of the transform
property. This maps better
to typical user interface usage, and saves having to remember the exact
order of transform functions to specify in the transform
value.
pub fn scroll_behavior(value: String) -> Style
The scroll-behavior
CSS property sets the behavior for a scrolling box
when scrolling is triggered by the navigation or CSSOM scrolling APIs.
Note that any other scrolls, such as those performed by the user, are not
affected by this property. When this property is specified on the root
element, it applies to the viewport instead. This property specified on
the body
element will not propagate to the viewport.
User agents are allowed to ignore this property.
pub fn scroll_margin(value: Length) -> Style
The scroll-margin
shorthand property sets all of the scroll margins of an
element at once, assigning values much like the margin
property does for
margins of an element.
This property is a shorthand for the following CSS properties:
pub fn scroll_margin_(value: String) -> Style
The scroll-margin
shorthand property sets all of the scroll margins of an
element at once, assigning values much like the margin
property does for
margins of an element.
This property is a shorthand for the following CSS properties:
pub fn scroll_margin_block(value: Length) -> Style
The scroll-margin-block
shorthand property sets the scroll margins of
an element in the block dimension.
This property is a shorthand for the following CSS properties:
pub fn scroll_margin_block_(value: String) -> Style
The scroll-margin-block
shorthand property sets the scroll margins of
an element in the block dimension.
This property is a shorthand for the following CSS properties:
pub fn scroll_margin_block_end(value: Length) -> Style
The scroll-margin-block-end
property defines the margin of the scroll
snap area at the end of the block dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_block_end_(value: String) -> Style
The scroll-margin-block-end
property defines the margin of the scroll
snap area at the end of the block dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_block_start(value: Length) -> Style
The scroll-margin-block-start
property defines the margin of the scroll
snap area at the start of the block dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_block_start_(value: String) -> Style
The scroll-margin-block-start
property defines the margin of the scroll
snap area at the start of the block dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_bottom(value: Length) -> Style
The scroll-margin-bottom
property defines the bottom margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_bottom_(value: String) -> Style
The scroll-margin-bottom
property defines the bottom margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_inline(value: Length) -> Style
The scroll-margin-inline
shorthand property sets the scroll margins of an
element in the inline dimension.
This property is a shorthand for the following CSS properties:
pub fn scroll_margin_inline_(value: String) -> Style
The scroll-margin-inline
shorthand property sets the scroll margins of an
element in the inline dimension.
This property is a shorthand for the following CSS properties:
pub fn scroll_margin_inline_end(value: Length) -> Style
The scroll-margin-inline-end
property defines the margin of the scroll
snap area at the end of the inline dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_inline_end_(value: String) -> Style
The scroll-margin-inline-end
property defines the margin of the scroll
snap area at the end of the inline dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_inline_start(value: Length) -> Style
The scroll-margin-inline-start
property defines the margin of the scroll
snap area at the start of the inline dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_inline_start_(value: String) -> Style
The scroll-margin-inline-start
property defines the margin of the scroll
snap area at the start of the inline dimension that is used for snapping this
box to the snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_left(value: Length) -> Style
The scroll-margin-left
property defines the left margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_left_(value: String) -> Style
The scroll-margin-left
property defines the left margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_right(value: Length) -> Style
The scroll-margin-right
property defines the right margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_right_(value: String) -> Style
The scroll-margin-right
property defines the right margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_top(value: Length) -> Style
The scroll-margin-top
property defines the top margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_margin_top_(value: String) -> Style
The scroll-margin-top
property defines the top margin of the scroll
snap area that is used for snapping this box to the
snapport.
The scroll snap area is determined by taking the transformed border box,
finding its rectangular bounding box (axis-aligned in the scroll container’s
coordinate space), then adding the specified outsets.
pub fn scroll_padding(value: Length) -> Style
The scroll-padding
shorthand property sets scroll padding on all sides of
an element at once, much like the padding
property does for padding on
an element.
The scroll-padding-*
properties define offsets for the optimal viewing
region of the scrollport: the region used as the target region for placing
things in view of the user. This allows the author to exclude regions of
the scrollport that are obscured by other content (such as fixed-positioned
toolbars or sidebars), or to put more breathing room between a targeted
element and the edges of the scrollport.
This property is a shorthand for the following CSS properties:
pub fn scroll_padding_(value: String) -> Style
The scroll-padding
shorthand property sets scroll padding on all sides of
an element at once, much like the padding
property does for padding on
an element.
The scroll-padding-*
properties define offsets for the optimal viewing
region of the scrollport: the region used as the target region for placing
things in view of the user. This allows the author to exclude regions of
the scrollport that are obscured by other content (such as fixed-positioned
toolbars or sidebars), or to put more breathing room between a targeted
element and the edges of the scrollport.
This property is a shorthand for the following CSS properties:
pub fn scroll_padding_block(value: Length) -> Style
The scroll-padding-block
shorthand property sets the scroll padding of
an element in the block dimension.
The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
This property is a shorthand for the following CSS properties:
pub fn scroll_padding_block_(value: String) -> Style
The scroll-padding-block
shorthand property sets the scroll padding of
an element in the block dimension.
The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
This property is a shorthand for the following CSS properties:
pub fn scroll_padding_block_end(value: Length) -> Style
The scroll-padding-block-end
property defines offsets for the end edge
in the block dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_block_end_(value: String) -> Style
The scroll-padding-block-end
property defines offsets for the end edge
in the block dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_block_start(value: Length) -> Style
The scroll-padding-block-start
property defines offsets for the start edge
in the block dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_block_start_(value: String) -> Style
The scroll-padding-block-start
property defines offsets for the start edge
in the block dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_bottom(value: Length) -> Style
The scroll-padding-bottom
property defines offsets for the bottom
of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_bottom_(value: String) -> Style
The scroll-padding-bottom
property defines offsets for the bottom
of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_inline(value: Length) -> Style
The scroll-padding-inline
shorthand property sets the scroll padding of an
element in the inline dimension.
The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
This property is a shorthand for the following CSS properties:
pub fn scroll_padding_inline_(value: String) -> Style
The scroll-padding-inline
shorthand property sets the scroll padding of an
element in the inline dimension.
The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
This property is a shorthand for the following CSS properties:
pub fn scroll_padding_inline_end(value: Length) -> Style
The scroll-padding-inline-end
property defines offsets for the end edge in
the inline dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_inline_end_(value: String) -> Style
The scroll-padding-inline-end
property defines offsets for the end edge in
the inline dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_inline_start(value: Length) -> Style
The scroll-padding-inline-start
property defines offsets for the start edge in
the inline dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_inline_start_(value: String) -> Style
The scroll-padding-inline-start
property defines offsets for the start edge in
the inline dimension of the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_left(value: Length) -> Style
The scroll-padding-left
property defines offsets for the left of
the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_left_(value: String) -> Style
The scroll-padding-left
property defines offsets for the left of
the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_right(value: Length) -> Style
The scroll-padding-right
property defines offsets for the right of
the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_right_(value: String) -> Style
The scroll-padding-right
property defines offsets for the right of
the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_top(value: Length) -> Style
The scroll-padding-top
property defines offsets for the top of
the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_padding_top_(value: String) -> Style
The scroll-padding-top
property defines offsets for the top of
the optimal viewing region of the scrollport:
the region used as the target region for placing things in view of the user.
This allows the author to exclude regions of the scrollport that are
obscured by other content (such as fixed-positioned toolbars or sidebars) or
to put more breathing room between a targeted element and the edges of the
scrollport.
pub fn scroll_snap_align(value: String) -> Style
The scroll-snap-align
property specifies the box’s snap position as an
alignment of its snap area
(as the alignment subject) within its snap container’s snap port
(as the alignment container).
pub fn scroll_snap_stop(value: String) -> Style
The scroll-snap-stop
CSS property defines whether or not the scroll
container is allowed to “pass over” possible snap positions.
pub fn scroll_snap_type(value: String) -> Style
The scroll-snap-type
CSS property is set on a
scroll container,
opting it into scroll snapping by setting the direction and strictness of
snap point enforcement within the
snap port.
pub fn scrollbar_color(value: String) -> Style
The scrollbar-color
CSS property sets the color of the scrollbar
track and thumb.
The track refers to the background of the scrollbar, which is generally fixed regardless of the scrolling position.
The thumb refers to the moving part of the scrollbar, which usually floats on top of the track.
When scrollbar-color
value is set on the document’s root element, the
values are applied to the viewport scrollbars.
pub fn scrollbar_gutter(value: String) -> Style
The scrollbar-gutter
CSS property allows authors to reserve space for the
scrollbar, preventing unwanted layout changes as the content grows while
also avoiding unnecessary visuals when scrolling isn’t needed.
An element’s scrollbar gutter is the space between the inner border edge and the outer padding edge, where the browser may display a scrollbar. If no scrollbar is present, the gutter will be painted as an extension of the padding.
The browser determines whether classic scrollbars or overlay scrollbars are used:
- Classic scrollbars are always placed in a gutter, consuming space when present.
- Overlay scrollbars are placed over the content, not in a gutter, and are usually partially transparent.
pub fn scrollbar_width(value: String) -> Style
The scrollbar-width
property allows the author to set the desired
thickness of an element’s scrollbars when they are shown.
The purpose of the scrollbar-width
is to optimize the space occupied by
the scrollbar on a page or element; the purpose is not related to scrollbar
aesthetics. The scrollbar-width
predefined keyword values indicate to the
user agent whether a normal or smaller scrollbar should be rendered. Avoid
using none
, as hiding a scrollbar negatively impacts accessibility.
For elements that are scrollable only via programmatic means and not by direct user interaction, use the
overflow
property with a value ofhidden
rather thanscrollbar-width: none
.
pub fn seeking(styles: List(Style)) -> Style
The :seeking
CSS
pseudo-class
represents an element that is playable, such as
<audio>
or
<video>
,
when the playable element is seeking a playback position in the media resource.
A resource is considered to be seeking if the user has requested playback of
a specific position in the media resource, but the media element has not yet
reached that position.
Seeking is different from :buffering
in that the media element is not
currently loading data, but is instead skipping to a new position in the
media resource. For more information, see the
Media buffering, seeking, and time ranges
guide.
pub fn selection(styles: List(Style)) -> Style
The ::selection
CSS
pseudo-element
applies styles to the part of a document that has been highlighted by the
user (such as clicking and dragging the mouse across text).
pub fn selector(value: String, styles: List(Style)) -> Style
Create an arbitrary selector. Every selector will be appended at the end of the class name selector.
pub fn my_class() {
css.class([
css.selector(":not(:disabled)", [
css.background("red"),
]),
])
}
Will output
.my_class {}
.my_class:not(:disabled) {
background: red;
}
pub fn shape_image_threshold(value: Float) -> Style
The shape-image-threshold
CSS property sets the alpha channel threshold
used to extract the shape using an image as the value for shape-outside
.
Any pixels whose alpha component’s value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries. For example, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque.
pub fn shape_image_threshold_(value: String) -> Style
The shape-image-threshold
CSS property sets the alpha channel threshold
used to extract the shape using an image as the value for shape-outside
.
Any pixels whose alpha component’s value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries. For example, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque.
pub fn shape_margin(value: Length) -> Style
The shape-margin
CSS property sets a margin for a CSS shape created
using shape-outside
.
The margin lets you adjust the distance between the edges of the shape (the float element) and the surrounding content.
pub fn shape_margin_(value: String) -> Style
The shape-margin
CSS property sets a margin for a CSS shape created
using shape-outside
.
The margin lets you adjust the distance between the edges of the shape (the float element) and the surrounding content.
pub fn shape_outside(value: String) -> Style
The shape-outside
CSS property defines a shape—which may be
non-rectangular—around which adjacent inline content should wrap. By default,
inline content wraps around its margin box; shape-outside
provides a way
to customize this wrapping, making it possible to wrap text around complex
objects rather than rectangular boxes.
pub fn spelling_error(styles: List(Style)) -> Style
The ::spelling-error
CSS
pseudo-element
represents a text segment which the user agent
has flagged as incorrectly spelled.
pub fn stalled(styles: List(Style)) -> Style
The :stalled
CSS
pseudo-class
represents an element that is playable, such as
<audio>
or
<video>
,
when playback is stalled. A resource is considered to be stalled if the user
has requested playback of a specific position in the media resource, but it
has failed to receive any data for some amount of time. This is different
from :buffering
in that the media element is unexpectedly not loading data
when stalled (e.g. due to a network error) for around 3 seconds (the exact time
is user agent dependent).
pub fn state(content: String, styles: List(Style)) -> Style
The :state()
CSS
pseudo-class
matches custom elements
that have the specified custom state.
pub fn subsequent_sibling(
class: Class,
styles: List(Style),
) -> Style
The subsequent-sibling combinator (~
, a tilde) separates two selectors
and matches all instances of the second element that follow the first
element (not necessarily immediately) and share the same parent element.
In the following example, the subsequent-sibling combinator (~
) helps to
select and style paragraphs that are both siblings of an image and appear
after any image.
img ~ p {
color: red;
}
pub fn tab_size(size: Length) -> Style
pub fn tab_size_(size: String) -> Style
pub fn table_layout(layout: String) -> Style
The table-layout
CSS property sets the algorithm used to lay out
<table>
cells, rows, and columns.
pub fn target(styles: List(Style)) -> Style
The :target
CSS
pseudo-class
represents a unique element (the target element) with an id
matching the
URL’s fragment.
pub fn text_align(text_align: String) -> Style
The text-align
CSS property sets the horizontal alignment of the
inline-level content inside a block element or table-cell box. This means
it works like vertical-align
but in the horizontal direction.
pub fn text_align_last(value: String) -> Style
The text-align-last
CSS property sets how the last line of a block or
a line, right before a forced line break, is aligned.
pub fn text_combine_upright(value: String) -> Style
The text-combine-upright
CSS property sets the combination of characters
into the space of a single character. If the combined text is wider than
1em, the user agent must fit the contents within 1em. The resulting
composition is treated as a single upright glyph for layout and decoration.
This property only has an effect in vertical writing modes.
This is used to produce an effect that is known as tate-chū-yoko “縦中横” in Japanese, or as “橫向文字” in Chinese.
pub fn text_decoration(text_decoration: String) -> Style
The text-decoration
shorthand CSS property sets the appearance of
decorative lines on text. It is a shorthand for text-decoration-line
,
text-decoration-color
, text-decoration-style
, and the newer
text-decoration-thickness
property.
Text decorations are drawn across descendant text elements. This means that
if an element specifies a text decoration, then a child element can’t remove
the decoration. For example, in the markup <p>This text has <em>some emphasized words</em> in it.</p>
, the style rule p { text-decoration: underline; }
would cause the entire paragraph to be underlined. The style rule
em { text-decoration: none; }
would not cause any change; the entire
paragraph would still be underlined. However, the rule
em { text-decoration: overline; }
would cause a second decoration to appear
on “some emphasized words”.
This property is a shorthand for the following CSS properties:
pub fn text_decoration_color(value: String) -> Style
The text-decoration-color
CSS property sets the color of decorations
added to text by text-decoration-line
.
The color applies to decorations, such as underlines, overlines, strikethroughs, and wavy lines like those used to mark misspellings, in the scope of the property’s value.
CSS does not provide a direct mechanism for specifying a unique color for
each line type. This effect can nevertheless be achieved by nesting
elements, applying a different line type to each element (with the
text-decoration-line
property), and specifying the line color (with
text-decoration-color
) on a per-element basis.
pub fn text_decoration_line(value: String) -> Style
The text-decoration-line
CSS property sets the kind of decoration that
is used on text in an element, such as an underline or overline.
When setting multiple line-decoration properties at once, it may be more
convenient to use the text-decoration
shorthand property instead.
pub fn text_decoration_skip_ink(value: String) -> Style
The text-decoration-skip-ink
CSS property specifies how overlines and
underlines are drawn when they pass over glyph ascenders and descenders.
text-decoration-skip-ink
is not part of the text-decoration shorthand.
pub fn text_decoration_style(value: String) -> Style
The text-decoration-style
CSS property sets the style of the lines
specified by text-decoration-line
. The style applies to all lines that
are set with text-decoration-line
.
If the specified decoration has a specific semantic meaning, like a
line-through line meaning that some text has been deleted, authors are
encouraged to denote this meaning using an HTML tag, like <del>
or <s>
.
As browsers can disable styling in some cases, the semantic meaning won’t
disappear in such a situation.
When setting multiple line-decoration properties at once, it may be more
convenient to use the text-decoration
shorthand property instead.
pub fn text_decoration_thickness(value: String) -> Style
The text-decoration-thickness
CSS property sets the stroke thickness of
the decoration line that is used on text in an element, such as a
line-through, underline, or overline.
pub fn text_emphasis(value: String) -> Style
The text-emphasis
CSS property applies emphasis marks to text (except
spaces and control characters). It is a shorthand for text-emphasis-style
and text-emphasis-color
.
The text-emphasis
property is quite different from text-decoration
.
The text-decoration
property does not inherit, and the decoration
specified is applied across the whole element. However, text-emphasis does
inherit, which means it is possible to change emphasis marks for descendants.
The size of the emphasis symbol, like ruby symbols, is about 50% of the size
of the font, and text-emphasis
may affect line height when the current
leading is not enough for the marks.
text-emphasis
doesn’t reset the value oftext-emphasis-position
. This is because if the style and the color of emphasis marks may vary in a text, it is extremely unlikely that their position will. In the very rare cases when this is needed, use the propertytext-emphasis-position
.
This property is a shorthand for the following CSS properties:
pub fn text_emphasis_color(value: String) -> Style
The text-emphasis-color
CSS property sets the color of emphasis marks.
This value can also be set using the text-emphasis
shorthand.
pub fn text_emphasis_position(value: String) -> Style
The text-emphasis-position
CSS property sets where emphasis marks are
drawn. Similar to the text rendered by the <ruby>
HTML element, if there
isn’t enough room for emphasis marks, the line height is increased.
pub fn text_emphasis_style(value: String) -> Style
The text-emphasis-style
CSS property sets the appearance of emphasis marks.
It can also be set, and reset, using the text-emphasis
shorthand.
pub fn text_indent(value: String) -> Style
The text-indent
CSS property sets the length of empty space (indentation)
that is put before lines of text in a block.
Horizontal spacing is with respect to the left (or right, for right-to-left layout) edge of the containing block-level element’s content box.
pub fn text_justify(text_justify: String) -> Style
The text-justify
CSS property sets what type of justification should be
applied to text when text-align: justify;
is set on an element.
pub fn text_orientation(value: String) -> Style
The text-orientation
CSS property sets the orientation of the text
characters in a line. It only affects text in vertical mode (when
writing-mode
is not horizontal-tb
). It is useful for controlling the
display of languages that use vertical script, and also for making vertical
table headers.
pub fn text_overflow(text_overflow: String) -> Style
The text-overflow
CSS property sets how hidden overflow content is
signaled to users. It can be clipped, display an ellipsis (…
), or
display a custom string.
The text-overflow
property doesn’t force an overflow to occur. To make text
overflow its container, you have to set other CSS properties: overflow
and white-space
. For example:
overflow: hidden;
white-space: nowrap;
The text-overflow
property only affects content that is overflowing a
block container element in its inline progression direction (not text
overflowing at the bottom of a box, for example).
pub fn text_rendering(value: String) -> Style
The text-rendering
CSS property provides information to the rendering
engine about what to optimize for when rendering text.
The browser makes trade-offs among speed, legibility, and geometric precision.
The
text-rendering
property is an SVG property that is not defined in any CSS standard. However, Gecko and WebKit browsers let you apply this property to HTML and XML content on Windows, macOS, and Linux.
One very visible effect is optimizeLegibility
, which enables ligatures
(ff, fi, fl, etc.) in text smaller than 20px for some fonts (for example,
Microsoft’s Calibri, Candara, Constantia, and Corbel, or the DejaVu
font family).
pub fn text_shadow(value: String) -> Style
The text-shadow
CSS property adds shadows to text. It accepts a
comma-separated list of shadows to be applied to the text and any of its
decorations
. Each shadow is described by some combination of X and Y
offsets from the element, blur radius, and color.
pub fn text_transform(text_transform: String) -> Style
The text-transform
CSS property specifies how to capitalize an element’s
text. It can be used to make text appear in all-uppercase or all-lowercase,
or with each word capitalized. It also can help improve legibility for ruby.
The text-transform
property takes into account language-specific case
mapping rules such as the following:
- In Turkic languages, like Turkish (
tr
), Azerbaijani (az
), Crimean Tatar (crh
), Volga Tatar (tt
), and Bashkir (ba
), there are two kinds ofi
, with and without the dot, and two case pairings:i
/İ
andı
/I
. - In German (
de
), theß
becomesSS
in uppercase. - In Dutch (
nl
), theij
digraph becomesIJ
, even withtext-transform: capitalize
, which only puts the first letter of a word in uppercase. - In Greek (
el
), vowels lose their accent when the whole word is in uppercase (ά
/Α
), except for the disjunctive eta (ή
/Ή
). Also, diphthongs with an accent on the first vowel lose the accent and gain a diaeresis on the second vowel (άι
/ΑΪ
). - In Greek (
el
), the lowercase sigma character has two forms:σ
andς
.ς
is used only when sigma terminates a word. When applyingtext-transform: lowercase
to an uppercase sigma (Σ
), the browser needs to choose the right lowercase form based on context. - in Irish (
ga
), certain prefixed letters remain in lowercase when the base initial is capitalized, so for exampletext-transform: uppercase
will changear aon tslí
toAR AON tSLÍ
and not, as one might expect,AR AON TSLÍ
(Firefox only). In some cases, a hyphen is also removed upon uppercasing:an t-uisce
transforms toAN tUISCE
(and the hyphen is correctly reinserted bytext-transform: lowercase
).
The language is defined by the lang
HTML attribute or the xml:lang
XML attribute.
pub fn text_underline_offset(value: Length) -> Style
The text-underline-offset
CSS property sets the offset distance of an
underline text decoration line (applied using text-decoration
) from its
original position.
text-underline-offset
is not part of the text-decoration
shorthand.
While an element can have multiple text-decoration
lines,
text-underline-offset
only impacts underlining, and not other possible
line decoration options such as overline
or line-through
.
pub fn text_underline_offset_(value: String) -> Style
The text-underline-offset
CSS property sets the offset distance of an
underline text decoration line (applied using text-decoration
) from its
original position.
text-underline-offset
is not part of the text-decoration
shorthand.
While an element can have multiple text-decoration
lines,
text-underline-offset
only impacts underlining, and not other possible
line decoration options such as overline
or line-through
.
pub fn text_underline_position(value: String) -> Style
The text-underline-position
CSS property specifies the position of the
underline which is set using the text-decoration
property’s underline value.
pub fn text_wrap(value: String) -> Style
The text-wrap
CSS shorthand property controls how text inside an element
is wrapped. The different values provide:
- Typographic improvements, for example more balanced line lengths across broken headings
- A way to turn text wrapping off completely.
The
white-space-collapse
andtext-wrap
properties can be declared together using thewhite-space
shorthand property.
This property is a shorthand for the following CSS properties:
pub fn text_wrap_mode(value: String) -> Style
The text-wrap-mode
CSS property controls whether the text inside an
element is wrapped. The different values provide alternate ways of wrapping
the content of a block element. It can also be set, and reset, using
the text-wrap
shorthand.
pub fn text_wrap_style(value: String) -> Style
The text-wrap-style
CSS property controls how text inside an element
is wrapped. The different values provide alternate ways of wrapping the
content of a block element. It can also be set, and reset, using
the text-wrap
shorthand.
pub fn top(size: Length) -> Style
The top
CSS property sets the vertical position of a
positioned element.
This inset property
has no effect on non-positioned elements.
The effect of top
depends on how the element is positioned (i.e., the
value of the position
property):
- When
position
is set toabsolute
orfixed
, thetop
property specifies the distance between the element’s outer margin of the top edge and the inner border of the top edge of its containing block, or, in the case of anchor positioned elements when theanchor()
function is used within the value, relative to the specified<anchor-side>
edge. Thetop
property is compatible with thetop
,bottom
,start
,end
,self-start
,self-end
,center
, and<percentage>
values. - When
position
is set torelative
, thetop
property specifies the distance the element’s top edge is moved below its normal position. - When
position
is set tosticky
, thetop
property is used to compute the sticky-constraint rectangle. - When
position
is set tostatic
, thetop
property has no effect.
When both top
and bottom
values are specified, there are three
different cases:
- If
position
is set toabsolute
orfixed
andheight
is unspecified (eitherauto
or100%
), both thetop
andbottom
values are respected. - If
position
is set torelative
orheight
is constrained, thetop
property takes precedence and thebottom
property is ignored. - If
position
is set tosticky
, bothtop
andbottom
values are considered. This means that a sticky element can potentially move up and down within its containing block based on the values of these two properties as long as the element’s position box remains contained within its containing block.
pub fn top_(size: String) -> Style
The top
CSS property sets the vertical position of a
positioned element.
This inset property
has no effect on non-positioned elements.
The effect of top
depends on how the element is positioned (i.e., the
value of the position
property):
- When
position
is set toabsolute
orfixed
, thetop
property specifies the distance between the element’s outer margin of the top edge and the inner border of the top edge of its containing block, or, in the case of anchor positioned elements when theanchor()
function is used within the value, relative to the specified<anchor-side>
edge. Thetop
property is compatible with thetop
,bottom
,start
,end
,self-start
,self-end
,center
, and<percentage>
values. - When
position
is set torelative
, thetop
property specifies the distance the element’s top edge is moved below its normal position. - When
position
is set tosticky
, thetop
property is used to compute the sticky-constraint rectangle. - When
position
is set tostatic
, thetop
property has no effect.
When both top
and bottom
values are specified, there are three
different cases:
- If
position
is set toabsolute
orfixed
andheight
is unspecified (eitherauto
or100%
), both thetop
andbottom
values are respected. - If
position
is set torelative
orheight
is constrained, thetop
property takes precedence and thebottom
property is ignored. - If
position
is set tosticky
, bothtop
andbottom
values are considered. This means that a sticky element can potentially move up and down within its containing block based on the values of these two properties as long as the element’s position box remains contained within its containing block.
pub fn touch_action(value: String) -> Style
The touch-action
CSS property sets how an element’s region can be
manipulated by a touchscreen user (for example, by zooming features built
into the browser).
By default, panning (scrolling) and pinching gestures are handled
exclusively by the browser. An application using
Pointer events
will receive a pointercancel
event when the browser starts handling a touch gesture. By explicitly
specifying which gestures should be handled by the browser, an application
can supply its own behavior in
pointermove
and
pointerup
listeners for the remaining gestures. Applications using
Touch events
disable the browser handling of gestures by calling
preventDefault()
,
but should also use touch-action
to ensure the browser knows the intent
of the application before any event listeners have been invoked.
When a gesture is started, the browser intersects the touch-action
values
of the touched element and its ancestors, up to the one that implements the
gesture (in other words, the first containing scrolling element). This means
that in practice, touch-action
is typically applied only to top-level
elements which have some custom behavior, without needing to specify
touch-action
explicitly on any of that element’s descendants.
After a gesture starts, changes to
touch-action
will not have any impact on the behavior of the current gesture.
pub fn transform(transform: List(Transform)) -> Style
The transform
CSS property lets you rotate, scale, skew, or translate an
element. It modifies the coordinate space of the CSS
visual formatting model.
If the property has a value different from none
, a
stacking context
will be created. In that case, the element will act as a
containing block
for any position: fixed;
or position: absolute;
elements that it contains.
Only transformable elements can be transformed. That is, all elements whose layout is governed by the CSS box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes.
transform
uses sketch/css/transform
to offer an enhanced API for CSS transforms.
pub fn transform_(transform: String) -> Style
The transform
CSS property lets you rotate, scale, skew, or translate an
element. It modifies the coordinate space of the CSS
visual formatting model.
If the property has a value different from none
, a
stacking context
will be created. In that case, the element will act as a
containing block
for any position: fixed;
or position: absolute;
elements that it contains.
Only transformable elements can be transformed. That is, all elements whose layout is governed by the CSS box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes.
pub fn transform_box(transform_box: String) -> Style
The transform-box
CSS property defines the layout box to which the
transform
, individual transform properties translate
, scale
, and
rotate
, and transform-origin
properties relate.
pub fn transform_origin(transform_origin: String) -> Style
The transform-origin
CSS property sets the origin for an element’s
transformations.
The transform origin is the point around which a transformation is applied.
For example, the transform origin of the rotate()
function is the center
of rotation.
In effect, this property wraps a pair of translations around the element’s other transformations. The first translation moves the transform origin to the true origin at (0,0). Then the other transformations are applied, and because the transform origin is at (0,0), those transformations act about the transform origin. Finally, the opposite translation is applied, moving the transform origin back to its original location. Consequently, this definition
transform-origin: -100% 50%;
transform: rotate(45deg);
results in the same transformation as
transform-origin: 0 0;
transform: translate(-100%, 50%) rotate(45deg) translate(100%, -50%);
Reading from right to left, translate(100%, -50%)
is the translation to
bring the transform origin to the true origin, rotate(45deg)
is the
original transformation, and translate(-100%, 50%)
is the translation to
restore the transform origin to its original location.
By default, the origin of a transform is center.
pub fn transform_style(transform_style: String) -> Style
The transform-style
CSS property sets whether children of an element are
positioned in the 3D space or are flattened in the plane of the element.
If flattened, the element’s children will not exist on their own in the 3D-space.
As this property is not inherited, it must be set for all non-leaf descendants of the element.
pub fn transition(transition: String) -> Style
The transition
CSS property is a shorthand property for
transition-property
, transition-duration
, transition-timing-function
,
transition-delay
, and transition-behavior
.
Transitions enable you to define the transition between two states of an
element. Different states may be defined using
pseudo-classes
like :hover
or :active
or dynamically set using JavaScript.
This property is a shorthand for the following CSS properties:
transition-behavior
transition-delay
transition-duration
transition-property
transition-timing-function
pub fn transition_behavior(value: String) -> Style
The transition-behavior
CSS property specifies whether transitions will be
started for properties whose animation behavior is
discrete.
pub fn transition_delay(value: String) -> Style
The transition-delay
CSS property specifies the duration to wait before
starting a property’s transition effect
when its value changes.
The delay may be zero, positive, or negative:
- A value of
0s
(or0ms
) will begin the transition effect immediately. - A positive value will delay the start of the transition effect for the given length of time.
- A negative value will begin the transition effect immediately, and partway through the effect. In other words, the effect will be animated as if it had already been running for the given length of time.
You may specify multiple delays, which is useful when transitioning multiple
properties. Each delay will be applied to the corresponding property as
specified by the transition-property
property, which acts as a master
list. If there are fewer delays specified than in the master list, the list
of delay values will be repeated until there are enough. If there are more
delays, the list of delay values will be truncated to match the number of
properties. In both cases, the CSS declaration remains valid.
pub fn transition_duration(value: String) -> Style
The transition-duration
CSS property sets the length of time a transition
animation should take to complete. By default, the value is 0s
, meaning
that no animation will occur.
You may specify multiple durations; each duration will be applied to the
corresponding property as specified by the transition-property
property,
which acts as a master list. If the number of specified durations is less
than in the master list, the user agent repeats the list of durations. If
the number of specified durations is more than in the master list, the list
is truncated to the right length. In both the cases, the CSS declaration
stays valid.
pub fn transition_property(value: String) -> Style
The transition-property
CSS property sets the CSS properties to which a
transition effect
should be applied.
If you specify a shorthand property (e.g., background
), all of its
longhand sub-properties that can be animated will be.
pub fn transition_timing_function(value: String) -> Style
The transition-timing-function
CSS property sets how intermediate values
are calculated for CSS properties being affected by a
transition effect.
This, in essence, lets you establish an acceleration curve so that the speed of the transition can vary over its duration.
This acceleration curve is defined using one
<easing-function>
for each property to be transitioned.
You may specify multiple easing functions; each one will be applied to the
corresponding property as specified by the transition-property
property,
which acts as a transition-property
list. If there are fewer easing
functions specified than in the transition-property
list, the user agent
must calculate which value is used by repeating the list of values until
there is one for each transition property. If there are more easing
functions, the list is truncated to the right length. In both cases, the CSS
declaration stays valid.
pub fn translate(translate: String) -> Style
The translate
CSS property allows you to specify translation transforms
individually and independently of the transform
property. This maps better
to typical user interface usage, and saves having to remember the exact
order of transform functions to specify in the transform
value.
pub fn unicode_bidi(value: String) -> Style
The unicode-bidi
CSS property, together with the direction
property,
determines how bidirectional text in a document is handled. For example,
if a block of content contains both left-to-right and right-to-left text,
the user-agent uses a complex Unicode algorithm to decide how to display
the text. The unicode-bidi
property overrides this algorithm and allows
the developer to control the text embedding.
The unicode-bidi
and direction
properties are the only properties that
are not affected by the all
shorthand.
Warning: This property is intended for Document Type Definition (DTD) designers. Web designers and similar authors should not override it.
pub fn user_invalid(styles: List(Style)) -> Style
The :user-invalid
CSS
pseudo-class
represents any validated form element whose value isn’t valid based on
their validation constraints,
after the user has interacted with it.
The :user-invalid
pseudo-class must match an :invalid
, :out-of-range
,
or blank-but :required
element between the time the user has attempted to
submit the form and before the user has interacted again with the form
element.
pub fn user_select(user_select: String) -> Style
The user-select
CSS property controls whether the user can select text.
This doesn’t have any effect on content loaded as part of a browser’s user
interface (its chrome), except in textboxes.
pub fn user_valid(styles: List(Style)) -> Style
The :user-valid
CSS
pseudo-class
represents any validated form element whose value validates correctly based on its
their validation constraints.
However, unlike :valid
it only matches once the user has interacted with it.
This pseudo-class is applied if the form control is valid and any of the following has occurred:
- The user made a change to the form control and committed the change such as by moving focus elsewhere.
- The user has attempted to submit the form, even if no change was made to the control.
- The value was invalid when it gained focus, and the user made a change making it valid, even if focus is still in the control.
Once this pseudo-class has been applied, the user-agent re-validates whether the control is valid at every keystroke when the control has focus.
- If the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. The result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control. However, if the user is /// trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. Required items are flagged as invalid only if the user changes them or attempts to submit an unchanged invalid value.
pub fn valid(styles: List(Style)) -> Style
The :valid
CSS
pseudo-class
represents any <input>
or other <form>
element whose contents validate
successfully. This allows to easily make valid fields adopt an appearance
that helps the user confirm that their data is formatted properly.
pub fn vector_effect(value: String) -> Style
The vector-effect
CSS property suppresses specific
transformation effects
in SVG, thus permitting effects like a road on a map staying the same width
no matter how the map is zoomed, or allowing a diagram key to retain its
position and size regardless of other transforms. It can only be used with
SVG elements that accept the vector-effect
attribute. When used, the CSS
value overrides any values of the element’s vector-effect
attribute.
pub fn vertical_align(value: String) -> Style
The vertical-align
CSS property sets vertical alignment of an inline,
inline-block or table-cell box.
The vertical-align property can be used in two contexts:
- To vertically align an inline-level element’s box inside its containing line box. For example, it could be used to vertically position an image in a line of text.
- To vertically align the content of a cell in a table.
Note that vertical-align
only applies to inline, inline-block and
table-cell elements: you can’t use it to vertically align block-level
elements.
pub fn visibility(visibility: String) -> Style
The visibility
CSS property shows or hides an element without changing
the layout of a document. The property can also hide rows or columns in
a <table>
.
To both hide an element and remove it from the document layout, set the
display
property to none
instead of using visibility
.
pub fn visited(styles: List(Style)) -> Style
The :visited
CSS
pseudo-class
applies once the link has been visited by the user. For privacy reasons,
the styles that can be modified using this selector are very limited.
The :visited
pseudo-class applies only to
<a>
and
<area>
elements that have an href attribute.
pub fn volume_locked(styles: List(Style)) -> Style
The :volume-locked
CSS
pseudo-class
selector represents an element that is capable of making sound, such as
<audio>
or <video>
,
but the audio volume of the media element is currently “locked” by the user.
User agents may set media muted
or volume
values according to user
preferences (e.g., remembering the last set value across sessions, on a
per-site basis, or otherwise). An element that is :volume-locked
cannot
be volume-locked, un-volume-locked, or have its volume changed via JavaScript because of an
operating system or user agent preference.
pub fn white_space(white_space: String) -> Style
The white-space
CSS property sets how white space inside an element is handled.
The property specifies two things:
- Whether and how white space is collapsed.
- Whether and how lines wrap.
To make words break within themselves, use
overflow-wrap
,word-break
, orhyphens
instead.
pub fn white_space_collapse(
white_space_collapse: String,
) -> Style
The white-space-collapse
CSS property controls how
white space
inside an element is collapsed.
The
white-space-collapse
andtext-wrap
properties can be declared together using thewhite-space
shorthand property.
pub fn widows(value: String) -> Style
pub fn width(width: Length) -> Style
The width
CSS property sets an element’s width. By default, it sets the
width of the content area,
but if box-sizing
is set to border-box
, it sets the width of the
border area.
The specified value of width
applies to the content area so long as its
value remains within the values defined by min-width
and max-width
.
- If the value for
width
is less than the value formin-width
, thenmin-width
overrideswidth
. - If the value for
width
is greater than the value formax-width
, thenmax-width
overrideswidth
.
Note: As a geometric property,
width
also applies to the<svg>
,<rect>
,<image>
, and<foreignObject>
SVG elements, withauto
resolving to 100% for<svg>
and 0 for other elements, and percent values being relative to the SVG viewportwidth
for<rect>
. The CSSwidth
property value overrides any SVGwidth
attribute value set on the SVG element.
pub fn width_(width: String) -> Style
The width
CSS property sets an element’s width. By default, it sets the
width of the content area,
but if box-sizing
is set to border-box
, it sets the width of the
border area.
The specified value of width
applies to the content area so long as its
value remains within the values defined by min-width
and max-width
.
- If the value for
width
is less than the value formin-width
, thenmin-width
overrideswidth
. - If the value for
width
is greater than the value formax-width
, thenmax-width
overrideswidth
.
Note: As a geometric property,
width
also applies to the<svg>
,<rect>
,<image>
, and<foreignObject>
SVG elements, withauto
resolving to 100% for<svg>
and 0 for other elements, and percent values being relative to the SVG viewportwidth
for<rect>
. The CSSwidth
property value overrides any SVGwidth
attribute value set on the SVG element.
pub fn will_change(value: String) -> Style
The will-change
CSS property hints to browsers how an element is expected
to change. Browsers may set up optimizations before an element is actually
changed. These kinds of optimizations can increase the responsiveness of a
page by doing potentially expensive work before they are actually required.
will-change
is intended to be used as a last resort, in order to try to deal with existing performance problems. It should not be used to anticipate performance problems.
Proper usage of this property can be a bit tricky:
- Don’t apply
will-change
to too many elements. The browser already tries as hard as it can to optimize everything. Some of the stronger optimizations that are likely to be tied towill-change
end up using a lot of a machine’s resources, and when overused like this can cause the page to slow down or consume a lot of resources. - Use sparingly. The normal behavior for optimizations that the browser
make is to remove the optimizations as soon as it can and revert back to
normal. But adding
will-change
directly in a stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise. So it is a good practice to switchwill-change
on and off using script code before and after the change occurs. - Don’t apply
will-change
to elements to perform premature optimization. If your page is performing well, don’t add thewill-change
property to elements just to wring out a little more speed.will-change
is intended to be used as something of a last resort, in order to try to deal with existing performance problems. It should not be used to anticipate performance problems. Excessive use ofwill-change
will result in excessive memory use and will cause more complex rendering to occur as the browser attempts to prepare for the possible change. This will lead to worse performance. - Give it sufficient time to work. This property is intended as a method
for authors to let the user-agent know about properties that are likely
to change ahead of time. Then the browser can choose to apply any ahead-of-time
optimizations required for the property change before the property change
actually happens. So it is important to give the browser some time to
actually do the optimizations. Find some way to predict at least slightly
ahead of time that something will change, and set
will-change
then. - Be aware, that
will-change
may actually influence the visual appearance of elements, when used with property values, that create a stacking context (e.g. will-change: opacity), as the stacking context is created up front.
pub fn word_break(word_break: String) -> Style
The word-break
CSS property sets whether line breaks appear wherever the
text would otherwise overflow its content box.
pub fn word_spacing(word_spacing: String) -> Style
The word-spacing
CSS property sets the length of space between words and
between tags.
pub fn writing_mode(value: String) -> Style
The writing-mode
CSS property sets whether lines of text are laid out
horizontally or vertically, as well as the direction in which blocks
progress. When set for an entire document, it should be set on the root
element (html
element for HTML documents).
This property specifies the block flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. Thus, it also determines the ordering of block-level content.
pub fn z_index(z_index: Int) -> Style
The z-index
CSS property sets the z-order of a
positioned
element and its descendants or flex and grid items. Overlapping elements
with a larger z-index cover those with a smaller one.
For a positioned box (that is, one with any position
other than static
),
the z-index property specifies:
- The stack level of the box in the current stacking context.
- Whether the box establishes a local stacking context.
pub fn zoom(value: String) -> Style
The zoom
CSS property can be used to control the magnification level of an
element. transform: scale()
can be used as an alternative to this property.
The zoom
CSS property scales the targeted element, which can affect the
page layout. When scaling, the zoomed element scales from top
and center
when using the default writing-mode
.
In contrast, an element scaled using scale()
will not cause layout
recalculation or move other elements on the page. If using scale()
makes
the contents larger than the containing element, then overflow
comes into
effect. Additionally, elements adjusted using scale()
transform from the
center
by default; this can be changed with the transform-origin
CSS
property.