Skip to content

Commit b133d47

Browse files
committed
refactor: switch ActionButtonGrid to BEM
1 parent febca22 commit b133d47

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

src/frontend/src/pad/buttons/ActionButtonGrid.scss

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838

3939
/* Separator styling */
40-
&__item.separator {
40+
&__separator {
4141
grid-column: 1 / span 2; /* Span across both columns */
4242
height: 1px;
4343
margin: 0;
@@ -64,3 +64,49 @@
6464
transform-origin: center;
6565
}
6666
}
67+
68+
/* Animation styles */
69+
.action-button-grid {
70+
&__item {
71+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Use a nice easing for the expansion */
72+
}
73+
74+
&__item--expanded {
75+
transform: scale(1.02); /* Slightly larger when expanded */
76+
transition-delay: 0.1s; /* Small delay before expanding */
77+
}
78+
}
79+
80+
/* Related component animations when parent is expanded */
81+
.action-button-grid__item--expanded {
82+
.action-button__wrapper {
83+
transform: scale(1);
84+
opacity: 1;
85+
transition: all 0.4s ease-in-out;
86+
}
87+
88+
.action-tabs__container {
89+
animation: fadeIn 0.4s ease-in-out 0.2s; /* Delay the animation to start after the button expands */
90+
animation-fill-mode: both; /* Keep the final state */
91+
}
92+
93+
.action-button__container {
94+
transition: all 0.4s ease-in-out;
95+
}
96+
}
97+
98+
/* For backward compatibility - can be removed once all code is updated */
99+
.action-button-grid__item.expanded {
100+
@extend .action-button-grid__item--expanded;
101+
}
102+
103+
@keyframes fadeIn {
104+
from {
105+
opacity: 0;
106+
transform: translateY(-10px);
107+
}
108+
to {
109+
opacity: 1;
110+
transform: translateY(0);
111+
}
112+
}

src/frontend/src/pad/buttons/ActionButtonGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const ActionButtonGrid: React.FC<ActionButtonGridProps> = ({
6464
))}
6565

6666
{/* Add separator element */}
67-
<div className="action-button-grid__item separator" key="separator"></div>
67+
<div className="action-button-grid__separator" key="separator"></div>
6868

6969
{/* Bottom row container with equal width buttons */}
7070
<div className="action-button-grid__bottom-row">

0 commit comments

Comments
 (0)