Skip to content

Commit eb1bb56

Browse files
committed
Add stylable svg icon
1 parent 551ea09 commit eb1bb56

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: README.md

+23
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,29 @@ Every webpage should look good on desktop, tablet and mobile.
141141
}
142142
```
143143

144+
## CSS stylable icons
145+
146+
Change color, background, border, and size of an icon with CSS. Use a white svg.
147+
148+
```html
149+
<svg
150+
viewBox="0 0 100 100"
151+
aria-label="my icon label"
152+
>
153+
<defs>
154+
<mask id="mask-id">
155+
<image xlink:href="/path/to/icon.svg" width="100" height="100" />
156+
</mask>
157+
</defs>
158+
<rect
159+
width="100"
160+
height="100"
161+
style="fill: currentColor"
162+
mask="url(#mask-id)"
163+
/>
164+
</svg>
165+
```
166+
144167
## Line clamp
145168

146169
Like `text-overflow: ellipsis`, but for multiple lines.

0 commit comments

Comments
 (0)