Skip to content

Commit 6a70082

Browse files
fix(avatar): update tokens and fix disable state (#30618)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - improve tokens usage; - now disable layer respects border-radius; ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> [basic](https://ionic-framework-git-rou-12136-ionic1.vercel.app/src/components/avatar/test/basic?ionic:theme=ionic) [shape](https://ionic-framework-git-rou-12136-ionic1.vercel.app/src/components/avatar/test/shape?ionic:theme=ionic) [size](https://ionic-framework-git-rou-12136-ionic1.vercel.app/src/components/avatar/test/size?ionic:theme=ionic) [states](https://ionic-framework-git-rou-12136-ionic1.vercel.app/src/components/avatar/test/states?ionic:theme=ionic)
1 parent 560a791 commit 6a70082

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

core/src/components/avatar/avatar.ionic.scss

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,40 @@
9696
:host(.avatar-xxsmall.avatar-soft),
9797
:host(.avatar-xsmall.avatar-soft),
9898
:host(.avatar-small.avatar-soft) {
99-
--border-radius: #{globals.$ion-border-radius-100};
99+
--border-radius: #{globals.$ion-soft-2xs};
100100
}
101-
102-
:host(.avatar-soft) {
103-
--border-radius: #{globals.$ion-border-radius-200};
101+
:host(.avatar-medium.avatar-soft) {
102+
--border-radius: #{globals.$ion-soft-xs};
103+
}
104+
:host(.avatar-large.avatar-soft),
105+
:host(.avatar-xlarge.avatar-soft) {
106+
--border-radius: #{globals.$ion-soft-md};
104107
}
105108

106-
:host(.avatar-round) {
107-
--border-radius: #{globals.$ion-border-radius-full};
109+
:host(.avatar-xxsmall.avatar-round),
110+
:host(.avatar-xsmall.avatar-round),
111+
:host(.avatar-small.avatar-round) {
112+
--border-radius: #{globals.$ion-round-2xs};
113+
}
114+
:host(.avatar-medium.avatar-round) {
115+
--border-radius: #{globals.$ion-round-xs};
116+
}
117+
:host(.avatar-large.avatar-round),
118+
:host(.avatar-xlarge.avatar-round) {
119+
--border-radius: #{globals.$ion-round-md};
108120
}
109121

110-
:host(.avatar-rectangular) {
111-
--border-radius: #{globals.$ion-border-radius-0};
122+
:host(.avatar-xxsmall.avatar-rectangular),
123+
:host(.avatar-xsmall.avatar-rectangular),
124+
:host(.avatar-small.avatar-rectangular) {
125+
--border-radius: #{globals.$ion-rectangular-2xs};
126+
}
127+
:host(.avatar-medium.avatar-rectangular) {
128+
--border-radius: #{globals.$ion-rectangular-xs};
129+
}
130+
:host(.avatar-large.avatar-rectangular),
131+
:host(.avatar-xlarge.avatar-rectangular) {
132+
--border-radius: #{globals.$ion-rectangular-md};
112133
}
113134

114135
// Avatar Icon
@@ -224,5 +245,6 @@
224245
// Avatar Disabled
225246
// --------------------------------------------------
226247
:host(.avatar-disabled)::before {
248+
@include globals.border-radius(var(--border-radius));
227249
@include globals.disabled-state();
228250
}

0 commit comments

Comments
 (0)