monks/stroke

The stroke CSS property defines the color or SVG paint server used to draw an element’s stroke. As such, stroke only has an effect on elements that can be given a stroke (for example, {{SVGElement(‘rect’)}} or {{SVGElement(‘ellipse’)}}); see the page on the SVG {{SVGAttr(‘stroke’)}} attribute for a complete list. When declared, the CSS value overrides any value of the element’s {{SVGAttr(“stroke”)}} SVG attribute.

According to the 4 April 2017 draft of the CSS Fill and Stroke Module Level 3 specification, the stroke property is a shorthand for a number of other stroke properties. In practice, as of August 2024, browsers do not support the setting of other stroke-related values such as width or dash patterns via the stroke property, treating it instead as a direct analogue of the SVG {{SVGAttr(“stroke”)}} attribute.

Values

pub const context_fill: #(String, String)

context-fill value of stroke

pub const context_stroke: #(String, String)
  • : Causes an element to “inherit” its stroke definition from its context element. If there is no valid context element, then this value will result in no paint being used for the stroke.
pub const inherit: #(String, String)
pub const initial: #(String, String)
pub const none: #(String, String)

none value of stroke

pub fn raw(value: String) -> #(String, String)

Enter a raw string value for stroke

pub const revert: #(String, String)
pub const revert_layer: #(String, String)
pub const unset: #(String, String)
pub fn var(variable: String) -> #(String, String)

Enter a variable name to be used for stroke. It will be wrapped in var() and have -- prepended.

Search Document