From a3ff47c48f95c8bb30e00b71016ffe9205283f65 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Feb 2022 20:14:31 +0000 Subject: [PATCH] Support aligning a color picker popover to the right --- packages/bbui/src/ColorPicker/ColorPicker.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bbui/src/ColorPicker/ColorPicker.svelte b/packages/bbui/src/ColorPicker/ColorPicker.svelte index 1fa950fadc..52a877415b 100644 --- a/packages/bbui/src/ColorPicker/ColorPicker.svelte +++ b/packages/bbui/src/ColorPicker/ColorPicker.svelte @@ -10,6 +10,7 @@ export let value export let size = "M" export let spectrumTheme + export let alignRight = false let open = false @@ -133,6 +134,7 @@ use:clickOutside={() => (open = false)} transition:fly={{ y: -20, duration: 200 }} class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open" + class:spectrum-Popover--align-right={alignRight} > {#each categories as category}
@@ -250,6 +252,9 @@ align-items: stretch; gap: var(--spacing-xl); } + .spectrum-Popover--align-right { + right: 0; + } .colors { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;