zfb
GitHub repository

Type to search...

to open search from anywhere

SVG paint

Set currentColor or none for SVG fill and stroke.

Set SVG paint with exact utility classes.

Quick reference

Example classExpected declarations
fill-nonefill: none;
stroke-currentstroke: currentColor;
fill-currentfill: currentColor;
stroke-nonestroke: none;
Example setup

These classes need no token configuration. The preview uses authored presentation CSS shown with the example.

Examples in use

SVG paint

svg-paint uses exact supported Wind utility classes.

SVG paint
HTML
<div class="wind-demo-new"><svg width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="Outlined circle"><circle class="fill-none stroke-current" cx="32" cy="32" r="24" stroke-width="4"/></svg><svg width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="Filled circle"><circle class="fill-current stroke-none" cx="32" cy="32" r="24"/></svg></div>
CSS
@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
  :root {
    --zw-spacing-unit: .25rem;
  }
}
.wind-demo-new {
  color: #203046;
  font: 14px / 1.5 system-ui, sans-serif;
}
.fill-current {
  fill: currentColor;
}
.fill-none {
  fill: none;
}
.stroke-current {
  stroke: currentColor;
}
.stroke-none {
  stroke: none;
}
Configuration for this example
{
  "wind": {
    "spec": 1,
    "reset": "none",
    "strict": true,
    "tokens": {
      "spacingUnit": "0.25rem"
    },
    "breakpoints": {},
    "defaultTransitionTimingFunction": "ease",
    "authoredClasses": {
      "wind-demo-new": true
    },
    "safelist": {
      "docs-preview": [
        "fill-none",
        "stroke-current",
        "fill-current",
        "stroke-none"
      ]
    }
  }
}
Authored demonstration CSS
.wind-demo-new { color: #203046; font: 14px/1.5 system-ui, sans-serif; }

Custom and named values

Only the exact current and none forms are supported; author other SVG paint values in CSS.

Related guides: Utility grammar · Variants

Catalog details

fill-current

FieldValue
Catalog identifierv1.fill-current
Class patternfill-current
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranksvg (48)
Order rank0
Selector shapeownElement
Spec version1
Emitter propertiesfill

Accepted values

KindSuffixEmitted value
exactnull"currentColor"

Declaration templates

PropertyValue kindFixed value
fillresolvednull

Catalog examples

Example classExpected declarations
fill-currentfill: currentColor

fill-none

FieldValue
Catalog identifierv1.fill-none
Class patternfill-none
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranksvg (48)
Order rank0
Selector shapeownElement
Spec version1
Emitter propertiesfill

Accepted values

KindSuffixEmitted value
exactnull"none"

Declaration templates

PropertyValue kindFixed value
fillresolvednull

Catalog examples

Example classExpected declarations
fill-nonefill: none

stroke-current

FieldValue
Catalog identifierv1.stroke-current
Class patternstroke-current
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranksvg (48)
Order rank1
Selector shapeownElement
Spec version1
Emitter propertiesstroke

Accepted values

KindSuffixEmitted value
exactnull"currentColor"

Declaration templates

PropertyValue kindFixed value
strokeresolvednull

Catalog examples

Example classExpected declarations
stroke-currentstroke: currentColor

stroke-none

FieldValue
Catalog identifierv1.stroke-none
Class patternstroke-none
Grammar{"acceptedKinds":["exact"],"arbitraryProperty":null,"allowsFractionSlash":false,"allowsColorOpacity":false}
Accepted values1
Token categoriesNo token category
Negative-value policyforbidden
Conflict group and ranksvg (48)
Order rank1
Selector shapeownElement
Spec version1
Emitter propertiesstroke

Accepted values

KindSuffixEmitted value
exactnull"none"

Declaration templates

PropertyValue kindFixed value
strokeresolvednull

Catalog examples

Example classExpected declarations
stroke-nonestroke: none

Revision History

CreatedUpdated