Skip to content

Commit 7b22db5

Browse files
Small docs update
1 parent 8361fff commit 7b22db5

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

preview-src/asciidoc/images.adoc

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Use the `icon` macro to invoke font icons from https://lucide.dev/icons/[Lucide
106106
The `icon` macro follows https://developers.google.com/style/ui-elements#buttons[accessibility standards] and provides built-in support for light and dark mode.
107107
108108
Lucide is the default icon set.
109-
You can invoke a Lucide icon with either `\icon:icon-name[]` or `\icon:lucide:icon-name[]`:
109+
You can invoke a Lucide icon with either `\icon:ICON-NAME[]` or `\icon:lucide:ICON-NAME[]`:
110110
111111
.Lucide
112112
[source,asciidoc]
@@ -121,28 +121,29 @@ icon:atom[title="Split the atom"] // <.>
121121
122122
icon:star[role="text-failure text-2xl"] // <.>
123123
124-
icon:star[size="60"] // <.>
125-
126-
icon:star[60] // <.>
124+
icon:star[size="60"] or icon:star[60] // <.>
127125
----
126+
128127
<.> Use the `name` attribute to add visible text to the right of the icon.
129128
130-
<.> Use the `alt` attribute to define an `aria-label` label for the icon.
129+
<.> Use the `alt` attribute to define an `aria-label` for the icon.
131130
The text is invisible but is read by screen readers.
132-
_Do not use `alt` if `name` is already defined._
131+
+
132+
_Do not use `alt` if `name` or `ariaLabel` is already defined._
133133
134-
<.> Use the `ariaLabel` attribute to define an `aria-label` label for the icon. This is the same as `alt`.
135-
_Do not use `ariaLabel` if `name` is already defined._
134+
<.> Identical to the `alt` attribute.
135+
+
136+
_Do not use `ariaLabel` if `name` or `alt` is already defined._
136137
137-
<.> The `title` attribute provides a visible tooltip on hover for pointer devices.
138-
_The `title` attribute is not read by most screen readers. Use `alt` or `ariaLabel` for accessibility._
139-
_The tooltip is not visible on touch devices._
138+
<.> The `title` attribute provides a visible tooltip on hover for pointer devices (not visible on touch devices).
139+
+
140+
_The `title` attribute is not read by most screen readers, and therefore its use is discouraged._
141+
_If used, make sure to also define `alt` or `ariaLabel` to ensure accessibility._
140142
141143
<.> Use the `role` attribute to apply Tailwind CSS classes to the icon.
142144
143-
<.> Use the `size` attribute to define the icon size in pixels.
144-
145-
<.> Use the first positional attribute to define the icon size in pixels. This is shorthand for the `size` attribute.
145+
<.> Use the `size` attribute to define the size of the icon in pixels.
146+
Alternatively, you can define the size in the first https://docs.asciidoctor.org/asciidoc/latest/attributes/positional-and-named-attributes/#positional[positional attribute] (shorthand for the `size` attribute).
146147
147148
You can invoke a Material icon with `\icon:material:icon-name[]`.
148149
All of the same attributes apply:
@@ -195,7 +196,7 @@ Inline material icons [.material-icons]#thumb_up#
195196
HTML passthrough::
196197
+
197198
--
198-
Use block or inline HTML passthrough to create an icon element `<i class="icon-{icon-name}"></i>`.
199+
Use block or inline HTML passthrough to create an icon element `<i class="icon-ICON-NAME"></i>`.
199200

200201
This method supports light and dark mode automatically.
201202

@@ -226,7 +227,7 @@ Inline lucide icons +++<i class="icon-boom-box"></i>+++
226227
// +
227228
// icon:atom[title="Split the atom"]
228229
// +
229-
// icon:star[role="text-warning text-2xl"]
230+
// icon:star[role="text-failure text-2xl"]
230231
// +
231232
// icon:star[size="60"]
232233

@@ -238,7 +239,7 @@ Inline lucide icons +++<i class="icon-boom-box"></i>+++
238239
// +
239240
// icon:material:volume-up[title="Turn it up"]
240241
// +
241-
// icon:material:directions-boat[role="text-failure text-2xl"]
242+
// icon:material:directions-boat[role="text-warning text-2xl"]
242243
// +
243244
// icon:material:thumb-up[size=60]
244245

@@ -252,29 +253,31 @@ Use the inline `svg` macro to display a local SVG file as an icon.
252253
----
253254
svg:ROOT:ui/icons/vector.svg[role="icon"] // <.>
254255
255-
svg:ROOT:ui/icons/vector.svg[role="icon text-2xl"] // <.>
256+
Click svg:ROOT:ui/icons/vector.svg[role="icon"] *Search* to run a similarity search based on the selected document's vector.
256257
257-
Click svg:ROOT:ui/icons/vector.svg[role="icon text-2xl"] *Search* to run a similarity search based on the selected document's vector.
258+
svg:ROOT:ui/icons/vector.svg[role="icon text-2xl"] // <.>
258259
259260
svg:ROOT:ui/icons/vector.svg[width="60",height="60"] // <.>
260261
----
261262
262-
<.> The `icon` role adds CSS styles that pin the width and height of the image to the font size of the parent element.
263+
<.> The `icon` role adds CSS styles that set the width and height of the image to an appropriate size relative to the font size of the parent element.
263264
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).
264265
265-
<.> You can control the size of the icon with Tailwind `text-*` utilities, such as `text-2xl` to enlarge the icon.
266+
<.> Manually control the icon size using Tailwind `text-*` utilities, such as `text-2xl`.
266267
267-
<.> You can also set the width and height of the svg directly.
268+
<.> Manually control the icon size using the `width` and `height` attributes.
268269
269270
[IMPORTANT]
270271
====
271272
Unlike <<font-icons,font icons>>, the `svg` macro doesn't automatically support light and dark mode.
272273
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.
274+
275+
If the svg is a simple, single-color icon, you can use `currentColor` for all fill and stroke colors.
276+
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.
274277
====
275278
======
276279

277-
// Click svg:ROOT:ui/icons/vector.svg[role="icon text-2xl"] *Search* to run a similarity search based on the selected document's vector.
280+
// Click svg:ROOT:ui/icons/vector.svg[role="icon"] *Search* to run a similarity search based on the selected document's vector.
278281

279282
[#inline-images]
280283
== Inline images

0 commit comments

Comments
 (0)