Skip to content

Commit 16d6136

Browse files
authored
Enhance addIcon method with options parameter
Updated the addIcon method to include an optional options parameter for monochrome rendering and added version information.
1 parent 5b83ef5 commit 16d6136

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/global-apis/acode.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,13 @@ acode.registerFormatter("com.example.plugin", ["js"], () => { // [!code focus]
157157

158158
This method is used to unregister a formatter. This method takes one parameter, `pluginId`. The pluginId is the ID of your plugin.
159159

160-
### `addIcon(iconName: string, iconSrc: string)`
160+
### `addIcon(iconName: string, iconSrc: string, options?: { monochrome?: boolean })`
161161

162-
This method is used to add an icon. This method takes two parameters, `iconName` and `iconSrc`. The `iconName` is the name of the icon. The `iconSrc` is the URL of the icon.
162+
This method is used to add an icon. This method takes two parameters, `iconName` , `iconSrc` and a optional. The `iconName` is the name of the icon. The `iconSrc` is the URL of the icon. If `options.monochrome` true, uses CSS masks to render the icon. This allows it to inherit the theme's currentColor(in case of svg).
163+
164+
::: info
165+
The `options.monochrome` is added in versionCode `967`.
166+
:::
163167

164168
**Example:**
165169

0 commit comments

Comments
 (0)