Skip to content
Snippets Groups Projects
Commit 123020d7 authored by nizune's avatar nizune
Browse files

Fix: Working on scrollable color swatch

parent 92964d74
No related merge requests found
...@@ -34,7 +34,7 @@ const presets = [ ...@@ -34,7 +34,7 @@ const presets = [
]; ];
const SwatchesBase = styled.div` const SwatchesBase = styled.div`
gap: 8px; /*gap: 8px;*/
display: flex; display: flex;
input { input {
...@@ -83,11 +83,21 @@ const Rows = styled.div` ...@@ -83,11 +83,21 @@ const Rows = styled.div`
gap: 8px; gap: 8px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: auto;
> div { > div {
gap: 8px; gap: 8px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding-inline-start: 8px;
}
.overlay {
position: absolute;
height: 68px;
width: 8px;
background: linear-gradient(to right, var(--primary-background), transparent);
} }
`; `;
...@@ -108,8 +118,11 @@ export default function ColourSwatches({ value, onChange }: Props) { ...@@ -108,8 +118,11 @@ export default function ColourSwatches({ value, onChange }: Props) {
ref={ref} ref={ref}
onChange={(ev) => onChange(ev.currentTarget.value)} onChange={(ev) => onChange(ev.currentTarget.value)}
/> />
<Rows> <Rows>
{presets.map((row, i) => ( {presets.map((row, i) => (
<>
<div class="overlay" />
<div key={i}> <div key={i}>
{row.map((swatch, i) => ( {row.map((swatch, i) => (
<Swatch <Swatch
...@@ -121,8 +134,11 @@ export default function ColourSwatches({ value, onChange }: Props) { ...@@ -121,8 +134,11 @@ export default function ColourSwatches({ value, onChange }: Props) {
</Swatch> </Swatch>
))} ))}
</div> </div>
</>
))} ))}
</Rows> </Rows>
</SwatchesBase> </SwatchesBase>
); );
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment