Skip to content

Commit 1fba120

Browse files
authored
Merge pull request #3473 from ilandikov/feat-arrange-delete-button
feat: arrange the delete button in the includes settings
2 parents d8e926f + dedc37a commit 1fba120

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/Config/IncludesSettingsUI.scss

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
.tasks-includes-setting {
1313
// Name input field (left column)
1414
.tasks-includes-key {
15-
width: 200px;
16-
flex-shrink: 0;
15+
grid-area: key;
1716

1817
// Error state styling
1918
&.has-error {
@@ -24,7 +23,8 @@
2423

2524
// Value textarea (right column)
2625
.tasks-includes-value {
27-
flex-grow: 1;
26+
grid-area: value;
27+
2828
min-width: 300px;
2929
min-height: 3em;
3030
font-family: var(--font-monospace);
@@ -36,13 +36,25 @@
3636
white-space: pre; // Preserve formatting
3737
}
3838

39+
.tasks-includes-delete-button {
40+
grid-area: delete;
41+
}
42+
3943
// Control alignment adjustment
4044
.setting-item-control {
45+
justify-content: start;
46+
display: grid;
47+
grid-template-columns: 200px 1fr auto;
48+
grid-template-areas: "key value delete";
49+
4150
align-items: unset;
4251

4352
// Force wrapping behavior on narrow screens
4453
@container (max-width: 600px) {
45-
flex-wrap: wrap;
54+
grid-template-columns: 5fr 1fr;
55+
grid-template-areas:
56+
"key delete"
57+
"value value";
4658

4759
// Put a border around the elements for each Include, to make structure easier
4860
// to see when in single-column mode.

src/Config/IncludesSettingsUI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export class IncludesSettingsUI {
127127

128128
// Add delete button
129129
setting.addExtraButton((btn) => {
130+
btn.extraSettingsEl.addClass('tasks-includes-delete-button');
130131
btn.setIcon('cross')
131132
.setTooltip('Delete')
132133
.onClick(async () => {

0 commit comments

Comments
 (0)