Module rsvg::property_defs
source · Expand description
Definitions for CSS property types.
Do not import things directly from this module; use the properties
module instead,
which re-exports things from here.
This module defines most of the CSS property types that librsvg supports. Each property requires a Rust type that will hold its values, and that type should implement a few traits, as follows.
§Requirements for a property type
You should call the [make_property
] macro to take care of most of these requirements
automatically:
-
A name for the type. For example, the
fill
property has aFill
type defined in this module. -
An initial value per the CSS or SVG specs, given through an implementation of the
Default
trait. -
Whether the property’s computed value inherits to child elements, given through an implementation of the
Property
trait and itsinherits_automatically
method. -
A way to derive the CSS computed value for the property, given through an implementation of the
Property
trait and itscompute
method. -
The actual underlying type. For example, the [
make_property
] macro can generate a field-less enum for properties like theclip-rule
property, which just has identifier-based values likenonzero
andevenodd
. For general-purpose types likeLength
, the macro can wrap them in a newtype likestruct
StrokeWidth
(
Length
)
. For custom types, the macro call can be used just to define the initial/default value and whether the property inherits automatically; you should provide the other required trait implementations separately. -
An implementation of the
Parse
trait for the underlying type.
Structs§
baseline-shift
property.cx
property.cy
attribute.clip-path
property.color
property, the fallback forcurrentColor
values.fill
property.fill-opacity
property.flood-color
property, forfeFlood
andfeDropShadow
filter elements.flood-opacity
property, forfeFlood
andfeDropShadow
filter elements.height
property.lighting-color
property forfeDiffuseLighting
andfeSpecularLighting
filter elements.marker
shorthand property.marker-end
property.marker-mid
property.marker-start
property.mask
shorthand property.opacity
property.paint-order
property.r
property.rx
property.ry
property.stop-color
property for gradient stops.stop-opacity
property for gradient stops.stroke
property.stroke-dasharray
property.stroke-dashoffset
property.stroke-miterlimit
property.stroke-opacity
property.stroke-width
property.text-decoration
shorthand property.transform
property.width
property.x
property.xml:lang
attribute.y
property.
Enums§
clip-rule
property.color-interpolation-filters
property.direction
property.display
property.dominant-baseline
property.enable-background
property.fill-rule
property.filter
property.font-stretch
property.font-style
property.font-variant
property.image-rendering
property.isolation
property.mask-type
property.mix-blend-mode
property.overflow
shorthand property.- One of the three operations for the
paint-order
property; seePaintOrder
. shape-rendering
property.stroke-linecap
property.stroke-linejoin
property.text-anchor
property.text-orientation
property.text-rendering
property.unicode-bidi
property.vector-effect
property.visibility
property.whitespace
propertieswriting-mode
property.xml:space
attribute.