Svg

Fill

Can I use ?
classproperties
fill:colorfill: color
fill:#hexfill: #hex
fill:rgb(rgb)fill: rgb(rgb)
fill:hsl(hsl)fill: hsl(hsl)

Overview

The fill attribute has two different meanings. For shapes and text it's a presentation attribute that defines the color (or any SVG paint servers like gradients or patterns) used to paint the element; for animation it defines the final state of the animation.

Colors

Use color please refer to Colors.

fill:fade-60
fill:gray-60
fill:brown-60
fill:orange-60
fill:gold-60/.4
fill:yellow-60/.4
fill:grass-60/.4
fill:green-60/.4
fill:beryl-60/.3
fill:teal-60/.3
fill:cyan-60/.3
fill:sky-60/.3
fill:blue-60/.2
fill:indigo-60/.2
fill:violet-60/.2
fill:purple-60/.2
fill:fuchsia-60/.1
fill:pink-60/.1
fill:crimson-60/.1
fill:red-60/.1

Hex

fill:rgb(135,141,159)
fill:rgb(141,141,143)
fill:rgb(175,131,110)
fill:rgb(213,115,30)
fill:rgb(192,128,0)
fill:rgb(172,138,0)
fill:rgb(104,156,19)
fill:rgb(8,163,69)
fill:rgb(0,161,112)
fill:rgb(0,159,148)
fill:rgb(0,153,193)
fill:rgb(11,146,238)
fill:rgb(83,140,238)
fill:rgb(125,132,232)
fill:rgb(158,119,245)
fill:rgb(181,108,236)
fill:rgb(224,78,229)
fill:rgb(238,82,163)
fill:rgb(234,91,130)
fill:rgb(235,95,99)

RGB

fill:rgb(135,141,159)
fill:rgb(141,141,143)
fill:rgb(175,131,110)
fill:rgb(213,115,30)
fill:rgb(192,128,0)
fill:rgb(172,138,0)
fill:rgb(104,156,19)
fill:rgb(8,163,69)
fill:rgb(0,161,112)
fill:rgb(0,159,148)
fill:rgb(0,153,193)
fill:rgb(11,146,238)
fill:rgb(83,140,238)
fill:rgb(125,132,232)
fill:rgb(158,119,245)
fill:rgb(181,108,236)
fill:rgb(224,78,229)
fill:rgb(238,82,163)
fill:rgb(234,91,130)
fill:rgb(235,95,99)

Applying with functions

<div class="fill:$(color)">...</div>

Master supports native CSS variables and functions, just add var(--key) or use shorthand$(key) for variables.

You can also use calc(expression), env(expression) and other CSS functions if the property supports it.

To learn more, see the Functions documentation.

Conditionally apply

States and selectors

<div class="fill:blue-60:hover">...</div>

Master supports all native CSS selectors, just add :hover, :disabled, chaining, combinators and other CSS selectors as usual.

To learn more, see the Selectors documentation.

Responsive breakpoints

<div class="fill:blue-60@sm">...</div>

Responsive breakpoints can be applied to all styles. Some available breakpoints are 3xs, 2xs, xs, sm,md, lg, xl, 2xl, 3xl, 4xl. Arbitrary breakpoints can be specified through comparison operators >, >=, <, <=.

To learn more, see the Breakpoints documentation.

<div class="fill:blue-60@print">...</div>

Master supports media types like print, screen, speech, all, and other media queries.

To learn more, see the Media Queries documentation.

Dark mode and color schemes

<div class="fill:blue-60@dark">...</div>

Master uses the selector html.dark to support color schemes. Now, you can easily fine-tune your style for the color schemes.

To learn more, see the Color Schemes documentation.


© Aoyue Design LLC.
Issue on this page
Edited byAronLola