@sj-distributor/react-iconfont-cli 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +1 -1
- package/templates/Icon.js.template +1 -0
- package/templates/Icon.tsx.template +1 -0
package/README.md
CHANGED
|
@@ -177,7 +177,11 @@ const handleIconClick = () => {
|
|
|
177
177
|
/>;
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
`buttonProps` 用于设置外层按钮的属性;`className`、`style` 等普通图标属性仍应用到内部 SVG。按钮默认为 `type="button"
|
|
180
|
+
`buttonProps` 用于设置外层按钮的属性;`className`、`style` 等普通图标属性仍应用到内部 SVG。按钮默认为 `type="button"`,并进行最小样式重置:背景透明、无边框、无内边距、鼠标指针为 `pointer`,同时移除浏览器原生按钮外观。
|
|
181
|
+
|
|
182
|
+
除此之外不附带布局、尺寸或颜色样式,调用方可以使用普通 CSS、CSS Modules 或 Tailwind CSS 自行控制。需要覆盖重置项时,可通过 `buttonProps.style` 设置。
|
|
183
|
+
|
|
184
|
+
原生按钮已经支持 Enter/Space 键盘操作,因此不需要额外添加 `onKeyDown`。
|
|
181
185
|
|
|
182
186
|
交互模式下,顶层的 `aria-*`、`role` 和 `tabIndex` 会自动应用到外层按钮,不会留在已隐藏的 SVG 上。除 `aria-label` 和 `onClick` 外,也可以通过 `buttonProps` 设置按钮属性;同名属性以 `buttonProps` 为准。
|
|
183
187
|
|
package/package.json
CHANGED