fix priority icon background

This commit is contained in:
callumalpass 2026-05-29 21:12:42 +10:00
parent c1a0899d75
commit ea7e8b512b
3 changed files with 35 additions and 0 deletions

View file

@ -33,6 +33,8 @@ Example:
- (#1964) Fixed Microsoft Calendar OAuth so connecting no longer forces a fresh consent prompt every time, and clarified the Microsoft desktop app setup steps.
- Thanks to @thechonta for reporting.
- (#1966) Fixed custom priority icons so they render as icons instead of filled squares on task cards.
- Thanks to @sruiz-savia for reporting.
- (#1963) Fixed Google Calendar sync so duplicate event ID fields are repaired when saving task calendar metadata.
- Thanks to @christenbc for reporting.
- (#1961) Fixed the default custom filename template so it uses the recommended double-brace syntax and no longer warns on first use.

View file

@ -1050,6 +1050,10 @@ body.is-mobile .tasknotes-plugin .task-card__context-menu svg {
justify-content: center;
}
.tasknotes-plugin .task-card[data-priority] > .task-card__main-row .task-card__priority-dot--icon {
background-color: transparent;
}
.tasknotes-plugin .task-card--priority-high > .task-card__main-row .task-card__priority-dot--icon,
.tasknotes-plugin .task-card--priority-medium > .task-card__main-row .task-card__priority-dot--icon,
.tasknotes-plugin .task-card--priority-normal > .task-card__main-row .task-card__priority-dot--icon,

View file

@ -0,0 +1,29 @@
import fs from "fs";
import path from "path";
function readRepoFile(relativePath: string): string {
return fs.readFileSync(path.resolve(__dirname, "../../../", relativePath), "utf8");
}
function extractCssBlock(css: string, selector: string): string {
const escapedSelector = selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const match = css.match(new RegExp(`${escapedSelector}\\s*\\{([^}]*)\\}`));
return match?.[1] ?? "";
}
describe("Issue #1966: priority icon backgrounds", () => {
it("keeps priority icon indicators transparent after data-priority color rules", () => {
const css = readRepoFile("styles/task-card-bem.css");
const colorSelector =
".tasknotes-plugin .task-card[data-priority] > .task-card__main-row .task-card__priority-dot";
const iconSelector =
".tasknotes-plugin .task-card[data-priority] > .task-card__main-row .task-card__priority-dot--icon";
const colorRuleIndex = css.indexOf(colorSelector);
const iconRuleIndex = css.indexOf(iconSelector);
expect(colorRuleIndex).toBeGreaterThanOrEqual(0);
expect(iconRuleIndex).toBeGreaterThan(colorRuleIndex);
expect(extractCssBlock(css, iconSelector)).toContain("background-color: transparent");
});
});