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
fillproperty has aFilltype defined in this module. -
An initial value per the CSS or SVG specs, given through an implementation of the
Defaulttrait. -
Whether the property’s computed value inherits to child elements, given through an implementation of the
Propertytrait and itsinherits_automaticallymethod. -
A way to derive the CSS computed value for the property, given through an implementation of the
Propertytrait and itscomputemethod. -
The actual underlying type. For example, the [
make_property] macro can generate a field-less enum for properties like theclip-ruleproperty, which just has identifier-based values likenonzeroandevenodd. For general-purpose types likeLength, the macro can wrap them in a newtype likestructStrokeWidth(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
Parsetrait for the underlying type.
Structs§
- Baseline
Shift baseline-shiftproperty.- CX
cxproperty.- CY
cyattribute.- Clip
Path clip-pathproperty.- Color
colorproperty, the fallback forcurrentColorvalues.- Fill
fillproperty.- Fill
Opacity fill-opacityproperty.- Flood
Color flood-colorproperty, forfeFloodandfeDropShadowfilter elements.- Flood
Opacity flood-opacityproperty, forfeFloodandfeDropShadowfilter elements.- Height
heightproperty.- Lighting
Color lighting-colorproperty forfeDiffuseLightingandfeSpecularLightingfilter elements.- Marker
markershorthand property.- Marker
End marker-endproperty.- Marker
Mid marker-midproperty.- Marker
Start marker-startproperty.- Mask
maskshorthand property.- Opacity
opacityproperty.- Paint
Order paint-orderproperty.- R
rproperty.- RX
rxproperty.- RY
ryproperty.- Stop
Color stop-colorproperty for gradient stops.- Stop
Opacity stop-opacityproperty for gradient stops.- Stroke
strokeproperty.- Stroke
Dasharray stroke-dasharrayproperty.- Stroke
Dashoffset stroke-dashoffsetproperty.- Stroke
Miterlimit stroke-miterlimitproperty.- Stroke
Opacity stroke-opacityproperty.- Stroke
Width stroke-widthproperty.- Text
Decoration text-decorationshorthand property.- Transform
transformproperty.- Width
widthproperty.- X
xproperty.- XmlLang
xml:langattribute.- Y
yproperty.
Enums§
- Clip
Rule clip-ruleproperty.- Color
Interpolation Filters color-interpolation-filtersproperty.- Direction
directionproperty.- Display
displayproperty.- Dominant
Baseline dominant-baselineproperty.- Enable
Background enable-backgroundproperty.- Fill
Rule fill-ruleproperty.- Filter
filterproperty.- Font
Stretch font-stretchproperty.- Font
Style font-styleproperty.- Font
Variant font-variantproperty.- Image
Rendering image-renderingproperty.- Isolation
isolationproperty.- Mask
Type mask-typeproperty.- MixBlend
Mode mix-blend-modeproperty.- Overflow
overflowshorthand property.- Paint
Target - One of the three operations for the
paint-orderproperty; seePaintOrder. - Shape
Rendering shape-renderingproperty.- Stroke
Linecap stroke-linecapproperty.- Stroke
Linejoin stroke-linejoinproperty.- Text
Anchor text-anchorproperty.- Text
Orientation text-orientationproperty.- Text
Rendering text-renderingproperty.- Unicode
Bidi unicode-bidiproperty.- Vector
Effect vector-effectproperty.- Visibility
visibilityproperty.- White
Space whitespaceproperties- Writing
Mode writing-modeproperty.- XmlSpace
xml:spaceattribute.