You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<.> The `icon` role adds CSS styles that pin the width and height of the image to the font size of the parent element.
250
263
Without the `icon` role, the image displays as large as possible unless a width and height is set in the SVG file itself (not recommended).
251
264
252
-
<.> Setting the `icon` role by itself usually leads to the icon appearing too small.
253
-
You can control the size of the icon with Tailwind `text-*` utilities, with `text-2xl` being the ideal size when the icon is used within body text.
265
+
<.> You can control the size of the icon with Tailwind `text-*` utilities, such as `text-2xl` to enlarge the icon.
266
+
267
+
<.> You can also set the width and height of the svg directly.
254
268
255
269
[IMPORTANT]
256
270
====
257
271
Unlike <<font-icons,font icons>>, the `svg` macro doesn't automatically support light and dark mode.
258
272
You'll need to add supported <<svg-images-css,CSS variables>> to the SVG file for the icon to display properly in light and dark mode.
273
+
If the svg is a simple, single-color icon, you can use `currentColor` for all fill and stroke colors. This will automatically inherit the text color of the parent element or the body text color which is black or white depending on the theme.
0 commit comments