You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/styling.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,6 +224,30 @@ Here's an example styling an accordion with different states:
224
224
225
225
## Advanced Styling Techniques
226
226
227
+
### CSS Transitions on Mount-Managed Surfaces
228
+
229
+
Components that manage their mount lifecycle for animations expose transient
230
+
`data-starting-style` and `data-ending-style` attributes on their animated
231
+
surfaces. This is useful for popup content, overlays, and similar parts where
232
+
you want enter and exit transitions without losing the close animation during
233
+
unmount.
234
+
235
+
```css
236
+
[data-popover-content] {
237
+
opacity: 1;
238
+
transform: scale(1);
239
+
transition:
240
+
opacity 150msease,
241
+
transform 150msease;
242
+
}
243
+
244
+
[data-popover-content][data-starting-style],
245
+
[data-popover-content][data-ending-style] {
246
+
opacity: 0;
247
+
transform: scale(0.96);
248
+
}
249
+
```
250
+
227
251
### Combining Data Attributes with CSS Variables
228
252
229
253
You can combine data attributes with CSS variables to create dynamic styles based on component state. Here's how to animate the accordion content using the `--bits-accordion-content-height` variable and the `data-state` attribute:
0 commit comments