8000 Add scale animation to icon on hover and active class by ahuang11 · Pull Request #6376 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions panel/dist/css/icon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:host(.bk-panel-models-icon-ToggleIcon) {
transition: opacity transform 0.3s ease-in;
}

:host(.bk-panel-models-icon-ToggleIcon:not(.active)) {
opacity: 0.8;
}

:host(.bk-panel-models-icon-ToggleIcon:hover) {
opacity: 1;
transform: scale(1.1);
}
1 change: 1 addition & 0 deletions panel/models/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class ClickableIconView extends ControlView {

async update_icon(): Promise<void> {
const icon = this.model.value ? this.get_active_icon() : this.model.icon;
this.class_list.toggle("active", this.model.value);
const is_svg_icon = this.is_svg_icon(icon)

if (this.was_svg_icon !== is_svg_icon) {
Expand Down
0