Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Use primary button blue in notebook data and join steps (#84299)

Oleh K5607d8e9bef2
diff --git a/e2e/test-component/scenarios/embedding-sdk/styles-tests.cy.spec.tsx b/e2e/test-component/scenarios/embedding-sdk/styles-tests.cy.spec.tsx
index 6f1c40cb19a..d7ea7da6397 100644
--- a/e2e/test-component/scenarios/embedding-sdk/styles-tests.cy.spec.tsx
+++ b/e2e/test-component/scenarios/embedding-sdk/styles-tests.cy.spec.tsx
@@ -63,6 +63,16 @@ describe("scenarios > embedding-sdk > styles", () => {
});
describe("theming", () => {
+ const assertBrandColor = (color: string) => {
+ getSdkRoot().within(() => {
+ cy.findByTestId("visualization-root").should("be.visible");
+ cy.findByTestId("notebook-button").click();
+ cy.findByText("Back to visualization")
+ .invoke("css", "color")
+ .should("equal", color);
+ });
+ };
+
const theme = defineMetabaseTheme({
colors: {
brand: "#FF0000",
@@ -75,14 +85,11 @@ describe("scenarios > embedding-sdk > styles", () => {
authConfig={DEFAULT_SDK_AUTH_PROVIDER_CONFIG}
theme={theme}
>
- <InteractiveQuestion questionId="new" />
+ <InteractiveQuestion questionId={ORDERS_QUESTION_ID} />
</MetabaseProvider>,
);
- getSdkRoot()
- .findByText("Pick your starting data")
- .invoke("css", "color")
- .should("equal", "rgb(255, 0, 0)");
+ assertBrandColor("rgb(255, 0, 0)");
});
it("should use the brand color from the app settings as fallback if they're present", () => {
@@ -98,14 +105,11 @@ describe("scenarios > embedding-sdk > styles", () => {
cy.mount(
<MetabaseProvider authConfig={DEFAULT_SDK_AUTH_PROVIDER_CONFIG}>
- <InteractiveQuestion questionId="new" />
+ <InteractiveQuestion questionId={ORDERS_QUESTION_ID} />
</MetabaseProvider>,
);
- getSdkRoot()
- .findByText("Pick your starting data")
- .invoke("css", "color")
- .should("equal", "rgb(0, 255, 0)");
+ assertBrandColor("rgb(0, 255, 0)");
});
it("but should prioritize the theme colors over the app settings", () => {
@@ -124,14 +128,11 @@ describe("scenarios > embedding-sdk > styles", () => {
authConfig={DEFAULT_SDK_AUTH_PROVIDER_CONFIG}
theme={theme}
>
- <InteractiveQuestion questionId="new" />
+ <InteractiveQuestion questionId={ORDERS_QUESTION_ID} />
</MetabaseProvider>,
);
- getSdkRoot()
- .findByText("Pick your starting data")
- .invoke("css", "color")
- .should("equal", "rgb(255, 0, 0)");
+ assertBrandColor("rgb(255, 0, 0)");
});
it('should be able to reset theme colors by setting it to "undefined" (EMB-696)', () => {
diff --git a/frontend/src/metabase/querying/notebook/components/DataStep/tests/setup.tsx b/frontend/src/metabase/querying/notebook/components/DataStep/tests/setup.tsx
index 4406b16c3a3..33111544be9 100644
--- a/frontend/src/metabase/querying/notebook/components/DataStep/tests/setup.tsx
+++ b/frontend/src/metabase/querying/notebook/components/DataStep/tests/setup.tsx
@@ -68,7 +68,7 @@ export const setup = async ({
query={step.query}
stageIndex={step.stageIndex}
readOnly={readOnly}
- color="core-brand"
+ color="background_surface-brand-strong"
isLastOpened={false}
reportTimezone="UTC"
updateQuery={updateQuery}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinComplete/JoinComplete.tsx b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinComplete/JoinComplete.tsx
index 0c6ddab04db..be14a8bbf24 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinComplete/JoinComplete.tsx
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinComplete/JoinComplete.tsx
@@ -136,7 +136,7 @@ export function JoinComplete({
</Flex>
</NotebookCell>
<Flex className={S.JoinConditionOn}>
- <Text c="core-brand" fw="bold">{t`on`}</Text>
+ <Text c="text-brand-strong" fw="bold">{t`on`}</Text>
</Flex>
<NotebookCell
className={S.JoinConditionCell}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinCondition/JoinCondition.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinCondition/JoinCondition.module.css
index c61f5ce952e..d32145c0a10 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinCondition/JoinCondition.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinCondition/JoinCondition.module.css
@@ -1,4 +1,4 @@
.JoinConditionRoot {
border-radius: 0.5rem;
- background-color: var(--mb-color-core-brand);
+ background-color: var(--mb-color-background_surface-brand-strong);
}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.module.css
index dca76425275..ac764c4098f 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.module.css
@@ -17,30 +17,22 @@
min-height: 39px;
padding: 8px 10px 6px 10px;
border-radius: 6px;
- background-color: var(--mb-color-core-brand);
+ background-color: var(--mb-color-background_surface-brand-strong);
&.isOpen {
- background-color: color-mix(
- in srgb,
- var(--mb-color-core-brand),
- white 10%
- );
+ background-color: var(--mb-color-background_surface-brand-strong-hover);
}
&:hover,
&:focus {
- background-color: color-mix(
- in srgb,
- var(--mb-color-core-brand),
- white 10%
- );
+ background-color: var(--mb-color-background_surface-brand-strong-hover);
}
}
&.noColumnStyle {
--no-column-style-alpha-color: color-mix(
in srgb,
- var(--mb-color-core-brand),
+ var(--mb-color-text-brand-strong),
white 45%
);
@@ -51,12 +43,12 @@
border-radius: 4px;
&.isOpen {
- border-color: var(--mb-color-core-brand);
+ border-color: var(--mb-color-text-brand-strong);
}
&:hover,
&:focus {
- border-color: var(--mb-color-core-brand);
+ border-color: var(--mb-color-text-brand-strong);
}
}
}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.tsx b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.tsx
index 83d5107a95d..db0b440d10d 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.tsx
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnButton/JoinColumnButton.tsx
@@ -90,7 +90,7 @@ export const JoinColumnButton = forwardRef(function JoinColumnTarget(
display="block"
fz={11}
lh={1}
- c={isEmpty ? "core-brand" : "text-primary-inverse"}
+ c={isEmpty ? "text-brand-strong" : "text-primary-inverse"}
ta="left"
fw={400}
>
@@ -100,7 +100,7 @@ export const JoinColumnButton = forwardRef(function JoinColumnTarget(
<Text
className={S.joinCellContent}
display="block"
- c={isEmpty ? "core-brand" : "text-primary-inverse"}
+ c={isEmpty ? "text-brand-strong" : "text-primary-inverse"}
ta="left"
fw={700}
lh={1}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnDropdown/JoinColumnDropdown.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnDropdown/JoinColumnDropdown.module.css
index de54bbde43b..3f4545b160a 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnDropdown/JoinColumnDropdown.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionColumnPicker/JoinColumnDropdown/JoinColumnDropdown.module.css
@@ -1,4 +1,4 @@
.joinColumnPicker {
- color: var(--mb-color-core-brand);
+ color: var(--mb-color-text-brand-strong);
overflow: visible;
}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionDraft/JoinConditionDraft.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionDraft/JoinConditionDraft.module.css
index 803f4444ff0..a1fcd498e77 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionDraft/JoinConditionDraft.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionDraft/JoinConditionDraft.module.css
@@ -3,7 +3,7 @@
transition: background-color 300ms linear;
background-color: color-mix(
in srgb,
- var(--mb-color-core-brand),
+ var(--mb-color-background_surface-brand-strong),
transparent 85%
);
}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionOperatorPicker/JoinConditionOperatorPicker.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionOperatorPicker/JoinConditionOperatorPicker.module.css
index 396e43b686c..cbef388238f 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionOperatorPicker/JoinConditionOperatorPicker.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionOperatorPicker/JoinConditionOperatorPicker.module.css
@@ -26,34 +26,26 @@
background-color: transparent;
&.isOpened {
- background-color: color-mix(
- in srgb,
- var(--mb-color-core-brand),
- white 10%
- );
+ background-color: var(--mb-color-background_surface-brand-strong-hover);
}
&:hover,
&:focus {
- background-color: color-mix(
- in srgb,
- var(--mb-color-core-brand),
- white 10%
- );
+ background-color: var(--mb-color-background_surface-brand-strong-hover);
}
}
&.incompleteCondition {
- color: var(--mb-color-core-brand);
+ color: var(--mb-color-text-brand-strong);
border: 2px solid transparent;
&.isOpened {
- border-color: var(--mb-color-core-brand);
+ border-color: var(--mb-color-text-brand-strong);
}
&:hover,
&:focus {
- border: 2px solid var(--mb-color-core-brand);
+ border: 2px solid var(--mb-color-text-brand-strong);
}
}
}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionRemoveButton/JoinConditionRemoveButton.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionRemoveButton/JoinConditionRemoveButton.module.css
index 5edba4b2fdf..1496951b83b 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionRemoveButton/JoinConditionRemoveButton.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinConditionRemoveButton/JoinConditionRemoveButton.module.css
@@ -18,11 +18,7 @@
&:hover,
&:focus {
- background-color: color-mix(
- in srgb,
- var(--mb-color-core-brand),
- white 10%
- );
+ background-color: var(--mb-color-background_surface-brand-strong-hover);
}
}
@@ -30,7 +26,7 @@
&:focus {
background-color: color-mix(
in srgb,
- var(--mb-color-core-brand),
+ var(--mb-color-background_surface-brand-strong),
transparent 20%
);
}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinDraft/JoinDraft.tsx b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinDraft/JoinDraft.tsx
index 86cdc357670..347d163252b 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinDraft/JoinDraft.tsx
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinDraft/JoinDraft.tsx
@@ -143,7 +143,7 @@ export function JoinDraft({
{rhsTable && (
<>
<Flex className={S.JoinConditionOn}>
- <Text c="core-brand" fw="bold">{t`on`}</Text>
+ <Text c="text-brand-strong" fw="bold">{t`on`}</Text>
</Flex>
<NotebookCell
className={S.JoinConditionCell}
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStep.unit.spec.tsx b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStep.unit.spec.tsx
index 86eb4c7f84e..29fd9cda4d1 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStep.unit.spec.tsx
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStep.unit.spec.tsx
@@ -217,7 +217,7 @@ function setup({
step={step}
stageIndex={step.stageIndex}
query={query}
- color="core-brand"
+ color="background_surface-brand-strong"
isLastOpened={false}
readOnly={readOnly}
reportTimezone="UTC"
diff --git a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStrategyPicker/JoinStrategyPicker.module.css b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStrategyPicker/JoinStrategyPicker.module.css
index 0ccccc57b60..ff18cc66ebd 100644
--- a/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStrategyPicker/JoinStrategyPicker.module.css
+++ b/frontend/src/metabase/querying/notebook/components/JoinStep/JoinStrategyPicker/JoinStrategyPicker.module.css
@@ -1,5 +1,5 @@
.JoinStrategyIcon {
- color: var(--mb-color-core-brand);
+ color: var(--mb-color-text-brand-strong);
}
.JoinStrategyList {
diff --git a/frontend/src/metabase/querying/notebook/components/NotebookDataPicker/NotebookDataPicker.tsx b/frontend/src/metabase/querying/notebook/components/NotebookDataPicker/NotebookDataPicker.tsx
index 30362d53789..e5f7435b657 100644
--- a/frontend/src/metabase/querying/notebook/components/NotebookDataPicker/NotebookDataPicker.tsx
+++ b/frontend/src/metabase/querying/notebook/components/NotebookDataPicker/NotebookDataPicker.tsx
@@ -112,7 +112,7 @@ export function NotebookDataPicker({
const canSelectTableColumns = table && isRaw && !isDisabled;
return (
<NotebookCellItem
- color="core-brand"
+ color="background_surface-brand-strong"
inactive={!table}
right={canSelectTableColumns && columnPicker}
containerStyle={{ padding: 0 }}
diff --git a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStep.module.css b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStep.module.css
index b6e4d7a923d..b2aaae4a994 100644
--- a/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStep.module.css
+++ b/frontend/src/metabase/querying/notebook/components/NotebookStep/NotebookStep.module.css
@@ -8,7 +8,7 @@
}
&:hover {
- color: var(--mb-color-core-brand);
+ color: var(--mb-color-text-brand-strong);
}
}
diff --git a/frontend/src/metabase/querying/notebook/components/NotebookStep/utils.ts b/frontend/src/metabase/querying/notebook/components/NotebookStep/utils.ts
index 18c172237b6..52ecedcf9e6 100644
--- a/frontend/src/metabase/querying/notebook/components/NotebookStep/utils.ts
+++ b/frontend/src/metabase/querying/notebook/components/NotebookStep/utils.ts
@@ -38,7 +38,7 @@ const STEPS: Record<NotebookStepType, StepUIItem> = {
get title() {
return t`Data`;
},
- color: () => "core-brand",
+ color: () => "background_surface-brand-strong",
Step: DataStep,
StepHeader: NotebookStepHeader,
},
@@ -49,7 +49,7 @@ const STEPS: Record<NotebookStepType, StepUIItem> = {
icon: "join_left_outer",
priority: 1,
compact: true,
- color: () => "core-brand",
+ color: () => "background_surface-brand-strong",
Step: JoinStep,
StepHeader: NotebookStepHeader,
},