From 15522ec9146f6f1956620355c44dea2a6a75b67c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 9 Oct 2023 18:26:23 +0200 Subject: refactor(components): replace ResponsiveImage with Figure component The styles applied to ResponsiveImage are related to the figure and figcaption elements. Those elements could be use with other contents than images. So I extracted them in a Figure component. The ResponsiveImage component is no longer useful: the consumer should use the Image component from `next` and wrap it in a link if needed. --- src/components/atoms/figure/figure.module.scss | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/components/atoms/figure/figure.module.scss (limited to 'src/components/atoms/figure/figure.module.scss') diff --git a/src/components/atoms/figure/figure.module.scss b/src/components/atoms/figure/figure.module.scss new file mode 100644 index 0000000..e7ba5c2 --- /dev/null +++ b/src/components/atoms/figure/figure.module.scss @@ -0,0 +1,30 @@ +@use "../../../styles/abstracts/functions" as fun; + +.caption { + margin: 0; + padding: fun.convert-px(4) var(--spacing-2xs); + background: var(--color-bg-secondary); + border: fun.convert-px(1) solid var(--color-border-light); + font-size: var(--font-size-sm); + font-weight: 500; +} + +.wrapper { + display: flex; + flex-flow: column; + width: fit-content; + margin: 0 auto; + position: relative; + text-align: center; + + &--has-borders { + padding: fun.convert-px(4); + border: fun.convert-px(1) solid var(--color-border); + box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) 0 + var(--color-shadow); + + .caption { + margin-top: fun.convert-px(4); + } + } +} -- cgit v1.2.3