-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custom class support to
Avatar
component (#285)
* feat: add custom class support to `Avatar` component * feat: update `Avatar` component demo titles The demo titles for the `Avatar` component have been updated to provide clearer instructions.
- Loading branch information
Showing
6 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/arcodesign/components/avatar/demo/custom-class.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## 自定义样式 @en{Custom Style} | ||
|
||
#### 8 | ||
|
||
```js | ||
import { Avatar } from '@arco-design/mobile-react'; | ||
|
||
export default function AvatarDemo() { | ||
return ( | ||
<div className="avatar-demo-box"> | ||
<Avatar avatarClass="avatar-1" /> | ||
<Avatar shape="square" avatarClass="avatar-2" className="avatar-left-margin" /> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
```less | ||
.avatar-demo-box { | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
} | ||
.avatar-left-margin { | ||
.set-prop-with-rtl(margin-left, 24px); | ||
} | ||
.avatar-1 { | ||
border-radius: 10px; | ||
background-color: coral; | ||
} | ||
.avatar-2 { | ||
width: 1rem; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters