diff --git a/.storybook/themes/commerce.scss b/.storybook/themes/commerce.scss index 77273249c7..d490585fd5 100644 --- a/.storybook/themes/commerce.scss +++ b/.storybook/themes/commerce.scss @@ -230,7 +230,7 @@ ), "carousel-track": ( "gap": initial, - "max-width": initial + "max-inline-size": initial ), "carousel-button-next": ( "background-color": transparent @@ -244,8 +244,11 @@ "box-shadow": inset 5px 0 0 0 var(--global-neutral-4), "font-style": italic, "gap": var(--global-spacing-2), - "padding": var(--global-spacing-4) 0 var(--global-spacing-4) var(--global-spacing-5), - "text-align": left, + "padding-block-start": var(--global-spacing-4), + "padding-inline-end": 0, + "padding-block-end": var(--global-spacing-4), + "padding-inline-start": var(--global-spacing-5), + "text-align": "start", "components": ( "paragraph": ( "font-size": var(--heading-level-6-font-size), @@ -254,7 +257,7 @@ ) ), "article-body-children": ( - "margin-bottom": var(--global-spacing-5) + "margin-block-end": var(--global-spacing-5) ), "article-body-citation": ( "font-family": var(--font-family-primary), @@ -264,7 +267,7 @@ "article-body-correction": ( "box-shadow": inset 0 -1px 0 0 var(--border-color), "font-style": italic, - "padding-bottom": var(--global-spacing-6), + "padding-block-end": var(--global-spacing-6), "components": ( "heading": ( "font-size": var(--heading-level-6-font-size), @@ -277,28 +280,28 @@ ), "article-body-divider": ( "background-color": var(--border-color), - "height": 1px + "block-size": 1px ), "article-body-embed-responsive": ( "aspect-ratio": calc(16 / 9), - "width": 100% + "inline-size": 100% ), "article-body-embed-responsive-item": ( "aspect-ratio": calc(16 / 9), - "height": auto, - "width": 100% + "block-size": auto, + "inline-size": 100% ), "article-body-full-screen-icon": ( "fill": var(--text-color), - "height": var(--global-spacing-4), - "width": var(--global-spacing-4) + "block-size": var(--global-spacing-4), + "inline-size": var(--global-spacing-4) ), "article-body-gallery": ( "components": ( "icon": ( "fill": var(--global-white), - "height": var(--global-spacing-8), - "width": var(--global-spacing-8) + "block-size": var(--global-spacing-8), + "inline-size": var(--global-spacing-8) ), "carousel-button": ( "background-color": transparent, @@ -313,16 +316,16 @@ "box-shadow": none, "color": var(--text-color), "font-size": var(--body-font-size-small), - "height": auto, - "width": auto + "block-size": auto, + "inline-size": auto ), "carousel-button-toggle-auto-play": ( "background-color": transparent, "box-shadow": none, "color": var(--text-color), "font-size": var(--body-font-size-small), - "height": auto, - "width": auto + "block-size": auto, + "inline-size": auto ), "carousel-image-counter": ( "font-size": var(--body-font-size-small) @@ -331,37 +334,37 @@ "background-color": var(--global-neutral-9), "gap": 0, "justify-content": center, - "width": 100% + "inline-size": 100% ), "media-item-fig-caption": ( "background-color": var(--global-white), - "padding-top": var(--global-spacing-2) + "padding-block-start": var(--global-spacing-2) ) ) ), "article-body-gallery-additional-next": ( "border": none, "display": none, - "height": var(--global-spacing-6), - "width": var(--global-spacing-6), + "block-size": var(--global-spacing-6), + "inline-size": var(--global-spacing-6), "components": ( "icon": ( "fill": var(--text-color), - "height": var(--global-spacing-4), - "width": var(--global-spacing-4) + "block-size": var(--global-spacing-4), + "inline-size": var(--global-spacing-4) ) ) ), "article-body-gallery-additional-previous": ( "border": none, "display": none, - "height": var(--global-spacing-6), - "width": var(--global-spacing-6), + "block-size": var(--global-spacing-6), + "inline-size": var(--global-spacing-6), "components": ( "icon": ( "fill": var(--text-color), - "height": var(--global-spacing-4), - "width": var(--global-spacing-4) + "block-size": var(--global-spacing-4), + "inline-size": var(--global-spacing-4) ) ) ), @@ -398,30 +401,30 @@ "article-body-image": ( "components": ( "image": ( - "max-width": 100% + "max-inline-size": 100% ) ) ), "article-body-image-float-left": ( - "width": 50%, - "float": left, - "margin-right": var(--global-spacing-5) + "inline-size": 50%, + "float": inline-start, + "margin-inline-end": var(--global-spacing-5) ), "article-body-image-float-right": ( - "width": 50%, - "float": right, - "margin-left": var(--global-spacing-5) + "inline-size": 50%, + "float": inline-end, + "margin-inline-start": var(--global-spacing-5) ), "article-body-image-wrapper": ( "align-items": center, "display": flex, "justify-content": center, - "max-height": 75vh, + "max-block-size": 75vh, "components": ( "image": ( - "height": auto, - "max-height": 75vh, - "max-width": 100% + "block-size": auto, + "max-block-size": 75vh, + "max-inline-size": 100% ) ) ), @@ -430,7 +433,9 @@ "font-style": italic, "components": ( "link": ( - "border-bottom": 1px solid var(--color-primary), + "border-block-end-width": 1px, + "border-block-end-style": solid, + "border-block-end-color": var(--color-primary), "color": var(--color-primary) ) ) @@ -447,7 +452,10 @@ "article-body-pullquote": ( "box-shadow": (inset 0 -5px 0 0 var(--border-color), inset 0 5px 0 0 var(--border-color)), "gap": var(--global-spacing-4), - "padding": var(--global-spacing-6) 0 var(--global-spacing-5), + "padding-block-start": var(--global-spacing-6) 0, + "padding-inline-end": var(--global-spacing-5), + "padding-block-end": var(--global-spacing-6) 0, + "padding-inline-start": var(--global-spacing-5), "text-align": center, "components": ( "paragraph": ( @@ -460,33 +468,72 @@ ), "article-body-start-icon": ( "fill": var(--text-color), - "height": var(--global-spacing-4), - "width": var(--global-spacing-4) + "block-size": var(--global-spacing-4), + "inline-size": var(--global-spacing-4) ), "article-body-stop-icon": ( "fill": var(--text-color), - "height": var(--global-spacing-4), - "width": var(--global-spacing-4) + "block-size": var(--global-spacing-4), + "inline-size": var(--global-spacing-4) ), "article-body-table": ( "font-family": var(--font-family-primary), "font-size": var(--body-font-size-small), "line-height": var(--body-line-height-small), "text-align": center, - "width": 100% + "inline-size": 100% ), "article-body-table-td": ( - "border": 1px solid var(--border-color), - "padding": var(--global-spacing-1) var(--global-spacing-2) + "border-block-start-width": 1px, + "border-block-end-width": 1px, + "border-inline-start-width": 1px, + "border-inline-end-width": 1px, + "border-block-start-style": solid, + "border-block-end-style": solid, + "border-inline-start-style": solid, + "border-inline-end-style": solid, + "border-block-start-color": var(--border-color), + "border-block-end-color": var(--border-color), + "border-inline-start-color": var(--border-color), + "border-inline-end-color": var(--border-color), + "padding-block-start": var(--global-spacing-1), + "padding-inline-end": var(--global-spacing-2), + "padding-block-end": var(--global-spacing-1), + "padding-inline-start": var(--global-spacing-2) ), "article-body-table-th": ( - "border": 1px solid var(--border-color), + "border-block-start-width": 1px, + "border-block-end-width": 1px, + "border-inline-start-width": 1px, + "border-inline-end-width": 1px, + "border-block-start-style": solid, + "border-block-end-style": solid, + "border-inline-start-style": solid, + "border-inline-end-style": solid, + "border-block-start-color": var(--border-color), + "border-block-end-color": var(--border-color), + "border-inline-start-color": var(--border-color), + "border-inline-end-color": var(--border-color), "font-weight": var(--global-font-weight-7), - "padding": var(--global-spacing-1) var(--global-spacing-2) + "padding-block-start": var(--global-spacing-1), + "padding-inline-end": var(--global-spacing-2), + "padding-block-end": var(--global-spacing-1), + "padding-inline-start": var(--global-spacing-2) ), "article-body-table-thead": ( "background-color": var(--global-neutral-4), - "border": 2px solid var(--border-color) + "border-block-start-width": 2px, + "border-block-end-width": 2px, + "border-inline-start-width": 2px, + "border-inline-end-width": 2px, + "border-block-start-style": solid, + "border-block-end-style": solid, + "border-inline-start-style": solid, + "border-inline-end-style": solid, + "border-block-start-color": var(--border-color), + "border-block-end-color": var(--border-color), + "border-inline-start-color": var(--border-color), + "border-inline-end-color": var(--border-color) ), "article-body-ul": ( "font-size": var(--body-font-size), diff --git a/.storybook/themes/news.scss b/.storybook/themes/news.scss index 5dbff90379..bd36297b6e 100644 --- a/.storybook/themes/news.scss +++ b/.storybook/themes/news.scss @@ -326,222 +326,272 @@ ) ), "article-body": ( - "font-family": var(--font-family-primary), - "font-size": var(--body-font-size), - "components": ( - "link": ( - "color": var(--color-primary) - ), - "paragraph": ( - "display": block, - "overflow": initial - ), - "media-item-fig-caption": ( - "background-color": var(--global-white), - "line-height": var(--body-line-height-5) - ), - "icon": ( - "fill": currentColor - ) - ) - ), - "article-body-blockquote": ( - "box-shadow": inset 5px 0 0 0 var(--global-neutral-4), - "font-style": italic, - "gap": var(--global-spacing-2), - "padding": var(--global-spacing-4) 0 var(--global-spacing-4) var(--global-spacing-5), - "text-align": left, - "components": ( - "paragraph": ( - "font-size": var(--heading-level-6-font-size), - "line-height": var(--heading-level-6-line-height) - ) - ) - ), - "article-body-children": ( - "margin-bottom": var(--global-spacing-5) - ), - "article-body-citation": ( - "font-family": var(--font-family-primary), - "font-style": normal, - "font-size": var(--body-font-size) - ), - "article-body-correction": ( - "box-shadow": inset 0 -1px 0 0 var(--border-color), - "font-style": italic, - "padding-bottom": var(--global-spacing-6), - "components": ( - "heading": ( - "font-size": var(--heading-level-6-font-size), - "text-transform": uppercase - ), - "paragraph": ( - "color": var(--global-neutral-6) - ) - ) - ), - "article-body-divider": ( - "background-color": var(--border-color), - "height": 1px - ), - "article-body-embed-responsive": ( - "aspect-ratio": calc(16 / 9), - "width": 100% - ), - "article-body-embed-responsive-item": ( - "aspect-ratio": calc(16 / 9), - "height": auto, - "width": 100% - ), - "article-body-gallery-close-button": ( - "color": var(--global-white), - "components": ( - "button-hover": ( - "color": var(--global-neutral-3) - ), - "icon": ( - "fill": currentColor, - "height": var(--global-spacing-6), - "width": var(--global-spacing-6) - ) - ) - ), - "article-body-gallery-fullscreen": ( - "components": ( - "media-item-fig-caption": ( - "padding": 0 var(--global-spacing-2) - ) - ) - ), - "article-body-gallery-track-button": ( - "color": var(--global-white), - "components": ( - "button-hover": ( - "color": var(--global-neutral-3) - ), - "icon": ( - "fill": currentColor, - "height": var(--global-spacing-8), - "width": var(--global-spacing-8) - ) - ) - ), - "article-body-h2": ( - "font-size": var(--heading-level-2-font-size), - "line-height": var(--heading-level-2-line-height), - "font-family": var(--font-family-primary), - "font-weight": bold - ), - "article-body-h3": ( - "font-size": var(--heading-level-3-font-size), - "line-height": var(--heading-level-3-line-height), - "font-family": var(--font-family-primary), - "font-weight": bold - ), - "article-body-h4": ( - "font-size": var(--heading-level-4-font-size), - "line-height": var(--heading-level-4-line-height), - "font-family": var(--font-family-primary), - "font-weight": bold - ), - "article-body-h5": ( - "font-size": var(--heading-level-5-font-size), - "line-height": var(--heading-level-5-line-height), - "font-family": var(--font-family-primary), - "font-weight": bold - ), - "article-body-h6": ( - "font-size": var(--heading-level-6-font-size), - "line-height": var(--heading-level-6-line-height), - "font-family": var(--font-family-primary), - "font-weight": bold - ), - "article-body-image-float-left": ( - "width": 50%, - "float": left, - "margin-right": var(--global-spacing-5) - ), - "article-body-image-float-right": ( - "width": 50%, - "float": right, - "margin-left": var(--global-spacing-5) - ), - "article-body-image-wrapper": ( - "align-items": center, - "aspect-ratio": calc(16/9), - "background-color": var(--global-black), - "display": flex, - "justify-content": center, - "max-height": 75vh, - "overflow": auto, - "components": ( - "image": ( - "height": auto, - "max-height": 100%, - "max-width": 100%, - "object-fit": contain - ) - ) - ), - "article-body-interstitial-link": ( - "font-family": var(--font-family-primary), - "font-style": italic, - "components": ( - "link": ( - "border-bottom": 1px solid var(--color-primary), - "color": var(--color-primary) - ) - ) - ), - "article-body-link": ( - "color": var(--color-primary) - ), - "article-body-ol": ( - "font-size": var(--body-font-size), - "line-height": var(--body-line-height), - "list-style-position": inside, - "list-style-type": decimal - ), - "article-body-pullquote": ( + "font-family": var(--font-family-primary), + "font-size": var(--body-font-size), + "components": ( + "link": ( + "color": var(--color-primary) + ), + "paragraph": ( + "display": block, + "overflow": initial + ), + "media-item-fig-caption": ( + "background-color": var(--global-white), + "line-height": var(--body-line-height-5) + ), + "icon": ( + "fill": currentColor + ) + ) + ), + "article-body-blockquote": ( + "box-shadow": inset 5px 0 0 0 var(--global-neutral-4), + "font-style": italic, + "gap": var(--global-spacing-2), + "padding-block-start": var(--global-spacing-4), + "padding-inline-end": 0, + "padding-block-end": var(--global-spacing-4), + "padding-inline-start": var(--global-spacing-5), + "text-align": start, + "components": ( + "paragraph": ( + "font-size": var(--heading-level-6-font-size), + "line-height": var(--heading-level-6-line-height) + ) + ) + ), + "article-body-children": ( + "margin-block-end": var(--global-spacing-5) + ), + "article-body-citation": ( + "font-family": var(--font-family-primary), + "font-style": normal, + "font-size": var(--body-font-size) + ), + "article-body-correction": ( + "box-shadow": inset 0 -1px 0 0 var(--border-color), + "font-style": italic, + "padding-block-end": var(--global-spacing-6), + "components": ( + "heading": ( + "font-size": var(--heading-level-6-font-size), + "text-transform": uppercase + ), + "paragraph": ( + "color": var(--global-neutral-6) + ) + ) + ), + "article-body-divider": ( + "background-color": var(--border-color), + "block-size": 1px + ), + "article-body-embed-responsive": ( + "aspect-ratio": calc(16 / 9), + "inline-size": 100% + ), + "article-body-embed-responsive-item": ( + "aspect-ratio": calc(16 / 9), + "block-size": auto, + "inline-size": 100% + ), + "article-body-gallery-close-button": ( + "color": var(--global-white), + "components": ( + "button-hover": ( + "color": var(--global-neutral-3) + ), + "icon": ( + "fill": currentColor, + "block-size": var(--global-spacing-6), + "inline-size": var(--global-spacing-6) + ) + ) + ), + "article-body-gallery-fullscreen": ( + "components": ( + "media-item-fig-caption": ( + "padding-block-start": 0, + "padding-inline-end": var(--global-spacing-2), + "padding-block-end": 0, + "padding-inline-start": var(--global-spacing-2) + ) + ) + ), + "article-body-gallery-track-button": ( + "color": var(--global-white), + "components": ( + "button-hover": ( + "color": var(--global-neutral-3) + ), + "icon": ( + "fill": currentColor, + "block-size": var(--global-spacing-8), + "inline-size": var(--global-spacing-8) + ) + ) + ), + "article-body-h2": ( + "font-size": var(--heading-level-2-font-size), + "line-height": var(--heading-level-2-line-height), + "font-family": var(--font-family-primary), + "font-weight": bold + ), + "article-body-h3": ( + "font-size": var(--heading-level-3-font-size), + "line-height": var(--heading-level-3-line-height), + "font-family": var(--font-family-primary), + "font-weight": bold + ), + "article-body-h4": ( + "font-size": var(--heading-level-4-font-size), + "line-height": var(--heading-level-4-line-height), + "font-family": var(--font-family-primary), + "font-weight": bold + ), + "article-body-h5": ( + "font-size": var(--heading-level-5-font-size), + "line-height": var(--heading-level-5-line-height), + "font-family": var(--font-family-primary), + "font-weight": bold + ), + "article-body-h6": ( + "font-size": var(--heading-level-6-font-size), + "line-height": var(--heading-level-6-line-height), + "font-family": var(--font-family-primary), + "font-weight": bold + ), + "article-body-image-float-left": ( + "inline-size": 50%, + "float": inline-start, + "margin-inline-end": var(--global-spacing-5) + ), + "article-body-image-float-right": ( + "inline-size": 50%, + "float": inline-end, + "margin-inline-start": var(--global-spacing-5) + ), + "article-body-image-wrapper": ( + "align-items": center, + "aspect-ratio": calc(16/9), + "background-color": var(--global-black), + "display": flex, + "justify-content": center, + "max-block-size": 75vh, + "overflow": auto, + "components": ( + "image": ( + "block-size": auto, + "max-block-size": 100%, + "max-inline-size": 100%, + "object-fit": contain + ) + ) + ), + "article-body-interstitial-link": ( + "font-family": var(--font-family-primary), + "font-style": italic, + "components": ( + "link": ( + "border-block-end-width": 1px, + "border-block-end-style": solid, + "border-block-end-color": var(--color-primary), + "color": var(--color-primary) + ) + ) + ), + "article-body-link": ( + "color": var(--color-primary) + ), + "article-body-ol": ( + "font-size": var(--body-font-size), + "line-height": var(--body-line-height), + "list-style-position": inside, + "list-style-type": decimal + ), + "article-body-pullquote": ( "box-shadow": (inset 0 -5px 0 0 var(--border-color), inset 0 5px 0 0 var(--border-color)), - "gap": var(--global-spacing-4), - "padding": var(--global-spacing-6) 0 var(--global-spacing-5), - "text-align": center, - "components": ( - "paragraph": ( - "font-style": italic, - "font-size": var(--heading-level-5-font-size), - "font-weight": var(--global-font-weight-7), - "line-height": var(--heading-level-5-line-height) - ) - ) - ), - "article-body-table": ( - "font-family": var(--font-family-primary), - "font-size": var(--body-font-size-small), - "line-height": var(--body-line-height-small), - "text-align": center, - "width": 100% - ), - "article-body-table-td": ( - "border": 1px solid var(--border-color), - "padding": var(--global-spacing-1) var(--global-spacing-2) - ), - "article-body-table-th": ( - "border": 1px solid var(--border-color), - "font-weight": var(--global-font-weight-7), - "padding": var(--global-spacing-1) var(--global-spacing-2) - ), - "article-body-table-thead": ( - "background-color": var(--global-neutral-4), - "border": 2px solid var(--border-color) - ), - "article-body-ul": ( - "font-size": var(--body-font-size), - "line-height": var(--body-line-height), - "list-style-position": inside, - "list-style-type": disc - ), + "gap": var(--global-spacing-4), + "padding-block-start": var(--global-spacing-6) 0, + "padding-inline-end": var(--global-spacing-5), + "padding-block-end": var(--global-spacing-6) 0, + "padding-inline-start": var(--global-spacing-5), + "text-align": center, + "components": ( + "paragraph": ( + "font-style": italic, + "font-size": var(--heading-level-5-font-size), + "font-weight": var(--global-font-weight-7), + "line-height": var(--heading-level-5-line-height) + ) + ) + ), + "article-body-table": ( + "font-family": var(--font-family-primary), + "font-size": var(--body-font-size-small), + "line-height": var(--body-line-height-small), + "text-align": center, + "inline-size": 100% + ), + "article-body-table-td": ( + "border-block-start-width": 1px, + "border-block-end-width": 1px, + "border-inline-start-width": 1px, + "border-inline-end-width": 1px, + "border-block-start-style": solid, + "border-block-end-style": solid, + "border-inline-start-style": solid, + "border-inline-end-style": solid, + "border-block-start-color": var(--border-color), + "border-block-end-color": var(--border-color), + "border-inline-start-color": var(--border-color), + "border-inline-end-color": var(--border-color), + "padding-block-start": var(--global-spacing-1), + "padding-inline-end": var(--global-spacing-2), + "padding-block-end": var(--global-spacing-1), + "padding-inline-start": var(--global-spacing-2) + ), + "article-body-table-th": ( + "border-block-start-width": 1px, + "border-block-end-width": 1px, + "border-inline-start-width": 1px, + "border-inline-end-width": 1px, + "border-block-start-style": solid, + "border-block-end-style": solid, + "border-inline-start-style": solid, + "border-inline-end-style": solid, + "border-block-start-color": var(--border-color), + "border-block-end-color": var(--border-color), + "border-inline-start-color": var(--border-color), + "border-inline-end-color": var(--border-color), + "font-weight": var(--global-font-weight-7), + "padding-block-start": var(--global-spacing-1), + "padding-inline-end": var(--global-spacing-2), + "padding-block-end": var(--global-spacing-1), + "padding-inline-start": var(--global-spacing-2) + ), + "article-body-table-thead": ( + "background-color": var(--global-neutral-4), + "border-block-start-width": 2px, + "border-block-end-width": 2px, + "border-inline-start-width": 2px, + "border-inline-end-width": 2px, + "border-block-start-style": solid, + "border-block-end-style": solid, + "border-inline-start-style": solid, + "border-inline-end-style": solid, + "border-block-start-color": var(--border-color), + "border-block-end-color": var(--border-color), + "border-inline-start-color": var(--border-color), + "border-inline-end-color": var(--border-color) + ), + "article-body-ul": ( + "font-size": var(--body-font-size), + "line-height": var(--body-line-height), + "list-style-position": inside, + "list-style-type": disc + ), "article-tag": ( "components": ( "stack": ( @@ -3492,12 +3542,15 @@ "article-body-gallery-fullscreen": ( "components": ( "media-item-fig-caption": ( - "padding": 0 var(--global-spacing-5) + "padding-block-start": 0, + "padding-inline-end": var(--global-spacing-5), + "padding-block-end": 0, + "padding-inline-start": var(--global-spacing-5) ) ) ), "article-body-image-wrapper": ( - "max-height": 75vh + "max-block-size": 75vh ), "author-bio-author-description": ( "font-size": var(--body-font-size), diff --git a/blocks/article-body-block/index.story.jsx b/blocks/article-body-block/index.story.jsx index e1565f29ed..c176a950e9 100644 --- a/blocks/article-body-block/index.story.jsx +++ b/blocks/article-body-block/index.story.jsx @@ -12,8 +12,12 @@ const styles = { backgroundColor: "rgb(240 240 240)", }; -const Comp1 = () =>