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/bespoke-transitions/README.md
+33-44Lines changed: 33 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -518,48 +518,42 @@ If there were multiple pairs defined by `view-transition-name` CSS property with
518
518
519
519
In this example, the icon image of "1" on every page is marked as morphable elements named "one" by `view-transition-name` CSS property.
520
520
521
-
Generally setting [`contain` CSS property][contain] as `layout` or `paint` is also required together with `view-transition-name`. If it lacked, the browser may ignore the morph transition with the error `Shared element must contain paint or layout`.
Marp is an open-sourced Markdown presentation ecosystem.
565
559
@@ -568,21 +562,16 @@ It provides a writing experience of presentation slides by Markdown.
568
562
569
563
#### Use HTML to mark morphable contents
570
564
571
-
By using an inline HTML with enabling raw HTML rendering by `--html` Marp CLI option, you can mark a group of morphable contents with more flexibility.
572
-
573
-
This example is defining the style of `morph` class, to mark the inner elements as morphable.
565
+
This example is defining the style for `data-morph` attribute, to mark the inner elements as morphable.
574
566
575
567
```markdown
576
568
---
577
569
header: Bubble sort
578
570
transition: fade
579
571
style: |
580
-
/* Define the style of "morph" class */
581
-
.morph {
582
-
display: inline-block;
583
-
view-transition-name: var(--morph-name);
584
-
contain: layout;
585
-
vertical-align: top;
572
+
/* Define the style of morphable elements (Requires Chrome 133 and later) */
The name of group can set through CSS variable in `style` attribute.
610
+
The name of morphable elements can set through `data-morph` attribute. Please note that this example is using [advanced `attr()` function](https://developer.chrome.com/blog/advanced-attr), that requires Chrome 133 and later.
622
611
623
612
<palign="center">
624
613
<imgsrc="./images/morphing-animation-2.gif"alt="Use HTML to mark morphable contents"width="480"height="270" />
625
614
</p>
626
615
627
-
Due to the security reason, Marp CLI does not render raw HTML tags in Markdown by default. You have to should add `--html` option to use inline HTMLs.
616
+
Due to the security reason, Marp CLI does not render `data-*` attributes in raw `<span>` elements in Markdown by default. You have to should add `--html` option to use.
0 commit comments