Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## unreleased

- Now a tab with a `color` is underlined only when it is active. ([#791](https://github.com/sqlpage/SQLPage/issues/791))

- Shell submenus stay open again when you click inside them. ([#1011](https://github.com/sqlpage/SQLPage/issues/1011))

- Refined the official website with muted blue accents, simpler navigation, a clearer primary action, and a level SQL ribbon with vertical separators, and a grounded studio scene with brushed metal and physical reflections. Restored visible progress in the streaming comparison animation.
Expand Down
2 changes: 1 addition & 1 deletion examples/official-site/sqlpage/migrations/13_tab.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ VALUES (
(
'tab',
'color',
'Color of the tab. See preview.tabler.io/colors.html for a list of available colors.',
'Color of the tab''s text, and of its underline when it is active. See preview.tabler.io/colors.html for a list of available colors.',
'TEXT',
FALSE,
TRUE
Expand Down
2 changes: 1 addition & 1 deletion sqlpage/templates/tab.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class="nav-link {{#if active~}}
active
{{~/if}} {{#if color~}}
text-{{color}} border-{{color}}
text-{{color}}{{#if active}} border-{{color}}{{/if}}
{{~/if}} {{#if center~}}
mx-auto
{{~/if}}"
Expand Down
3 changes: 3 additions & 0 deletions tests/end-to-end/fixtures/tab/colored/index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT 'tab' AS component;
SELECT 'Red' AS title, 'red' AS color;
SELECT 'Green' AS title, 'green' AS color, TRUE AS active;
13 changes: 13 additions & 0 deletions tests/end-to-end/fixtures/tab/colored/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect, test } from "../../../fixture.ts";

test("only the active colored tab is underlined, in its color", async ({
page,
}) => {
const inactive = page.getByRole("link", { name: "Red" });
const active = page.getByRole("link", { name: "Green" });
await expect(inactive).toHaveCSS("border-bottom-color", "rgba(0, 0, 0, 0)");
const activeColor = await active.evaluate(
(link) => getComputedStyle(link).color,
);
await expect(active).toHaveCSS("border-bottom-color", activeColor);
});
Loading