diff --git a/src/lib/Figure.svelte b/src/lib/Figure.svelte index 9e0eb96..48df604 100644 --- a/src/lib/Figure.svelte +++ b/src/lib/Figure.svelte @@ -13,6 +13,7 @@ export let fill = false export let narrow = false + export let bleed = false export let label = 'Figure' /** @type {string?} */ @@ -25,7 +26,7 @@ const index = ofType.indexOf(item) -
+
@@ -76,14 +77,19 @@ } .main { - background: #f2f3f8; padding: var(--page-gutter); user-select: none; } .figure:not(.fill) .main { border-radius: 0.5rem; - padding: 1.5rem; + padding: 1rem; + border: 1px solid #d7d9dd; + } + + .figure.bleed .main { + border: 0; + padding: 0; } @media (width > 70rem) { @@ -95,7 +101,7 @@ .figure:not(.fill):not(.narrow) .main { max-width: var(--text-width); - flex: 0 0 auto; + flex: 0 0 100%; } .figure:not(.fill):not(.narrow) .caption { @@ -107,6 +113,7 @@ .figure :global(img) { display: block; width: 100%; + border-radius: 0.5rem; } .caption { diff --git a/src/lib/Menu.svelte b/src/lib/Menu.svelte index ea50f81..a26c994 100644 --- a/src/lib/Menu.svelte +++ b/src/lib/Menu.svelte @@ -147,6 +147,18 @@ --menu-color: var(--theme-text-color); } + .menu:is(:not(.open, :target, .color)) .fade-1 { + opacity: 0.7; + } + + .menu:is(:not(.open, :target, .color)) .fade-2 { + opacity: 0.5; + } + + .menu:is(:not(.open, :target, .color)) .fade-3 { + opacity: 0.2; + } + @media (width <= 80rem) { .menu:is(.open, :target) { position: fixed; diff --git a/src/lib/Modules.svelte b/src/lib/Modules.svelte index a3db004..1a50d85 100644 --- a/src/lib/Modules.svelte +++ b/src/lib/Modules.svelte @@ -154,12 +154,13 @@ {/if}
{:else if module._type === 'figure'} -
+
+ label={module.label}> {#if module.image} {module.image.alt {:else if module.embed?.content} diff --git a/src/routes/(sanity)/studio/[...rest]/types/figure.jsx b/src/routes/(sanity)/studio/[...rest]/types/figure.jsx index 88410ce..ae957f9 100644 --- a/src/routes/(sanity)/studio/[...rest]/types/figure.jsx +++ b/src/routes/(sanity)/studio/[...rest]/types/figure.jsx @@ -63,6 +63,13 @@ export default defineType({ initialValue: false, description: 'Grow the figure to cover as much space as possible' }, + { + name: 'bleed', + type: 'boolean', + title: 'No padding', + initialValue: false, + description: 'Hide the gray outline, good for photos and pictures' + }, { name: 'description', type: 'array',