|
183 | 183 | </script> |
184 | 184 |
|
185 | 185 | <ha-card |
186 | | - class={`expander-card${config.clear ? ' clear' : ''}${open ? ' open' : ' close'}`} |
| 186 | + class={`expander-card${config.clear ? ' clear' : ''}${open ? ' open' : ' close'} ${animationState} ${config.animation ? 'animation' : ''}`} |
187 | 187 | style="--expander-card-display:{config['expander-card-display']}; |
188 | | - --gap:{open ? config['expanded-gap'] : config.gap}; --padding:{config.padding}; |
| 188 | + --gap:{open && animationState !=='closing' ? config['expanded-gap'] : config.gap}; --padding:{config.padding}; |
189 | 189 | --expander-state:{open}; |
190 | 190 | --icon-rotate-degree:{config['icon-rotate-degree']}; |
191 | 191 | --card-background:{open && config['expander-card-background-expanded'] ? config['expander-card-background-expanded']: config['expander-card-background']} |
|
240 | 240 | <div class="children-wrapper {config.animation ? 'animation ' + animationState : ''}"> |
241 | 241 | <div |
242 | 242 | style="--expander-card-display:{config['expander-card-display']}; |
243 | | - --gap:{open ? config['expanded-gap'] : config.gap}; --child-padding:{open ? config['child-padding'] : '0px'};" |
244 | | - class="children-container" |
| 243 | + --gap:{open && animationState !=='closing' ? config['expanded-gap'] : config.gap}; |
| 244 | + --child-padding:{open && animationState !=='closing' ? config['child-padding'] : '0px'};" |
| 245 | + class="children-container{open ? ' open' : ' close'} {animationState} {config.animation ? 'animation' : ''}" |
245 | 246 | > |
246 | 247 | {#each config.cards as card (card)} |
247 | 248 | <Card hass={hass} |
|
267 | 268 | padding: var(--padding); |
268 | 269 | background: var(--card-background,#fff); |
269 | 270 | } |
| 271 | + .expander-card.animation { |
| 272 | + transition: gap 0.35s ease; |
| 273 | + } |
270 | 274 | .children-wrapper { |
271 | 275 | display: flex; |
272 | 276 | flex-direction: column; |
|
275 | 279 | .children-wrapper.animation.closing { |
276 | 280 | overflow: hidden; |
277 | 281 | } |
| 282 | + .children-container.animation { |
| 283 | + transition: padding 0.35s ease, gap 0.35s ease; |
| 284 | + } |
278 | 285 | .children-container { |
279 | 286 | padding: var(--child-padding); |
280 | 287 | display: var(--expander-card-display,block); |
|
0 commit comments