Module 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 a Fill 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 its inherits_automatically method.

  • A way to derive the CSS computed value for the property, given through an implementation of the Property trait and its compute method.

  • The actual underlying type. For example, the [make_property] macro can generate a field-less enum for properties like the clip-rule property, which just has identifier-based values like nonzero and evenodd. For general-purpose types like Length, the macro can wrap them in a newtype like struct 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§

BaselineShift
baseline-shift property.
CX
cx property.
CY
cy attribute.
ClipPath
clip-path property.
Color
color property, the fallback for currentColor values.
Fill
fill property.
FillOpacity
fill-opacity property.
FloodColor
flood-color property, for feFlood and feDropShadow filter elements.
FloodOpacity
flood-opacity property, for feFlood and feDropShadow filter elements.
Height
height property.
LightingColor
lighting-color property for feDiffuseLighting and feSpecularLighting filter elements.
Marker
marker shorthand property.
MarkerEnd
marker-end property.
MarkerMid
marker-mid property.
MarkerStart
marker-start property.
Mask
mask shorthand property.
Opacity
opacity property.
PaintOrder
paint-order property.
R
r property.
RX
rx property.
RY
ry property.
StopColor
stop-color property for gradient stops.
StopOpacity
stop-opacity property for gradient stops.
Stroke
stroke property.
StrokeDasharray
stroke-dasharray property.
StrokeDashoffset
stroke-dashoffset property.
StrokeMiterlimit
stroke-miterlimit property.
StrokeOpacity
stroke-opacity property.
StrokeWidth
stroke-width property.
TextDecoration
text-decoration shorthand property.
Transform
transform property.
Width
width property.
X
x property.
XmlLang
xml:lang attribute.
Y
y property.

Enums§

ClipRule
clip-rule property.
ColorInterpolationFilters
color-interpolation-filters property.
Direction
direction property.
Display
display property.
DominantBaseline
dominant-baseline property.
EnableBackground
enable-background property.
FillRule
fill-rule property.
Filter
filter property.
FontStretch
font-stretch property.
FontStyle
font-style property.
FontVariant
font-variant property.
ImageRendering
image-rendering property.
Isolation
isolation property.
MaskType
mask-type property.
MixBlendMode
mix-blend-mode property.
Overflow
overflow shorthand property.
PaintTarget
One of the three operations for the paint-order property; see PaintOrder.
ShapeRendering
shape-rendering property.
StrokeLinecap
stroke-linecap property.
StrokeLinejoin
stroke-linejoin property.
TextAnchor
text-anchor property.
TextOrientation
text-orientation property.
TextRendering
text-rendering property.
UnicodeBidi
unicode-bidi property.
VectorEffect
vector-effect property.
Visibility
visibility property.
WhiteSpace
whitespace properties
WritingMode
writing-mode property.
XmlSpace
xml:space attribute.