Skip to content

Commit

Permalink
Tweak dnd-target visual effect
Browse files Browse the repository at this point in the history
Also fixed missing dnd-target effect in collections tree (regression in 1.5.0)
  • Loading branch information
tnajdek committed Aug 5, 2024
1 parent 8783c0b commit c09391d
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 35 deletions.
1 change: 0 additions & 1 deletion src/scss/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
@import "mixins/selectors";
@import "mixins/hairline";
@import "mixins/button";
@import "mixins/dnd-target";
@import "mixins/theme";
16 changes: 0 additions & 16 deletions src/scss/abstracts/mixins/_dnd-target.scss

This file was deleted.

5 changes: 2 additions & 3 deletions src/scss/abstracts/mixins/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
--color-shade-10-50: #{transparentize(map.get($colors, "color-shade-10"), 0.5)};
--color-shade-2-50: #{transparentize(map.get($colors, "color-shade-2"), 0.5)};

--color-text-selection-bg: rgba(map.get($colors, "accent-blue"), 0.2);
--color-text-selection-bg: rgba(map.get($colors, "accent-blue"), 0.2);
--color-dnd-target: rgba(map.get($colors, "accent-blue"), 0.25);
--color-text-selection-bg: #{rgba(map.get($colors, "accent-blue"), 0.2)};
--color-text-selection-bg: #{rgba(map.get($colors, "accent-blue"), 0.2)};

// composite (opaque) colors
--color-quinary-on-background: #{color.mix(
Expand Down
6 changes: 5 additions & 1 deletion src/scss/components/_collection-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@

@include state(".item-container.dnd-target", "li.selected > .item-container.dnd-target") {
@include mouse-and-bp-up(md) {
@include dnd-target;
color: var(--material-background);
background: var(--fill-secondary);
}
}

Expand Down Expand Up @@ -218,6 +219,9 @@
@include state("li.picked > .item-container") {
color: var(--primary-on-accent);
}
@include state(".item-container.dnd-target", "li.selected > .item-container.dnd-target") {
color: var(--material-background);
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/scss/components/attachment/_pane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

&.dnd-target {
position: relative;
@include dnd-target;
color: var(--material-background);
background: var(--fill-secondary);
}

> .toolbar {
Expand Down
17 changes: 10 additions & 7 deletions src/scss/components/item/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
}

&.dnd-target {
@include dnd-target;

&::after {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
background-color: transparent;
outline: 3px solid var(--color-dnd-target-outline);
outline-offset: -3px;
outline: 2px solid var(--fill-secondary);
outline-offset: -2px;
opacity: 0.5;
}
}
}
Expand Down Expand Up @@ -234,16 +236,17 @@
}
}

&.dnd-target {
@include dnd-target;
&.dnd-target:not(.specifity) {
color: var(--material-background);
background: var(--fill-secondary);
}

&.dnd-target-top, &.dnd-target-bottom + .item {
overflow: visible !important;

&::before {
content: "";
background: $item-table-dnd-target-bg;
background: var(--fill-secondary);
position: absolute;
top: -1px;
width: 80px;
Expand Down
3 changes: 2 additions & 1 deletion src/scss/components/tag/_selector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
}

&.dnd-target {
background-color: $dnd-target-color;
color: var(--material-background);
background: var(--fill-secondary);
}

.tag-label {
Expand Down
5 changes: 0 additions & 5 deletions src/scss/themes/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ $item-table-head-active-bg: $shade-1;
$item-table-odd-bg: var(--color-shade-1-darker);
$item-table-active-bg: $shade-3;
$sort-indicator: var(--accent-blue);
$item-table-dnd-target-bg: $shade-5;

// Item details
$item-details-border-1x: $shade-3;
Expand Down Expand Up @@ -147,7 +146,6 @@ $btn-icon-separator-color: $shade-3;
$twisty-color: $shade-6;
$twisty-focus-color: var(--accent-asphalt);
$twisty-selected-color: $shade-7;
$twisty-dnd-target-color: $shade-0;

// Forms
$form-bg-touch: $shade-1;
Expand Down Expand Up @@ -248,9 +246,6 @@ $popover-arrow-outer-color: rgba(0, 0, 0, 0.2);
$ongoing-border-color: $shade-3;
$ongoing-color: $shade-8;

// Drag and drop target
$dnd-target-color: var(--color-dnd-target);

// Identifier picker
$result-border-color: $shade-2;
$result-hover-color: $shade-0;
Expand Down

0 comments on commit c09391d

Please sign in to comment.