Skip to content

Commit

Permalink
explorer: unify css
Browse files Browse the repository at this point in the history
  • Loading branch information
deuch13 committed Jul 22, 2024
1 parent fb4a715 commit 46cb763
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down Expand Up @@ -2565,7 +2565,7 @@ exports[`Blocks Card > should disable the \`Show More\` button is the card is in
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down Expand Up @@ -2605,7 +2605,7 @@ exports[`Blocks Card > should render the \`BlocksCard\` component 1`] = `
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`DataCard > should render the \`DataCard\` in the data state 1`] = `
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down Expand Up @@ -53,7 +53,7 @@ exports[`DataCard > should render the \`DataCard\` in the data state when loadin
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down Expand Up @@ -91,7 +91,7 @@ exports[`DataCard > should render the \`DataCard\` in the error state 1`] = `
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down Expand Up @@ -159,7 +159,7 @@ exports[`DataCard > should render the \`DataCard\` in the loading state 1`] = `
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down Expand Up @@ -198,7 +198,7 @@ exports[`DataCard > should render the \`DataCard\` in the no data state 1`] = `
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down Expand Up @@ -250,7 +250,7 @@ exports[`DataCard > should render the \`DataCard\` with a disabled button 1`] =
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`Search Notification > renders the Search Notification component with a
</span>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal dusk-icon-button search-notification__header-action"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal dusk-icon-button search-notification__header-action"
type="button"
>
Expand Down Expand Up @@ -67,7 +67,7 @@ exports[`Search Notification > renders the Search Notification component with th
</span>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal dusk-icon-button search-notification__header-action"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal dusk-icon-button search-notification__header-action"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if the card
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down Expand Up @@ -55,7 +55,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down Expand Up @@ -3042,7 +3042,7 @@ exports[`Transactions Card > should render the \`TransactionsCard\` component 1`
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down
1 change: 0 additions & 1 deletion explorer/src/lib/components/block-details/BlockDetails.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

.block-details__list-anchor {
display: flex;
color: var(--primary-color);
}

.block-details__gas-used.dusk-progress-bar {
Expand Down
1 change: 0 additions & 1 deletion explorer/src/lib/components/data-card/DataCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { DataAlert } from "$lib/components";
import { Button, Card, ProgressBar } from "$lib/dusk/components";
import { makeClassName } from "$lib/dusk/string";
import { appStore } from "$lib/stores";
import "./DataCard.css";
Expand Down
2 changes: 2 additions & 0 deletions explorer/src/lib/components/navbar/Navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

.dusk-navbar__toggle {
background-color: transparent;
color: var(--primary-color);
display: inline-flex;
align-items: center;
font-size: 1rem;
Expand All @@ -37,6 +38,7 @@

.dusk-navbar__toggle:focus {
outline: none;
box-shadow: none;
}

.dusk-navbar__menu {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
position: "after",
size: "normal",
}}
variant={"tertiary"}
variant="tertiary"
/>
</header>
{#if data.res instanceof Error}
Expand Down
12 changes: 8 additions & 4 deletions explorer/src/lib/dusk/components/select/Select.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
letter-spacing: inherit;
padding: var(--control-padding);
padding-right: 2.25em;
background-color: var(--control-bg-color);
background-color: var(--non-button-control-bg-color);
border-color: var(--control-border-color);
border-radius: var(--control-border-radius-size);
border-style: solid;
Expand All @@ -21,14 +21,18 @@
background-image: linear-gradient(
45deg,
transparent 50%,
var(--control-text-color) 50%
var(--non-button-control-text-color) 50%
),
linear-gradient(135deg, var(--control-text-color) 50%, transparent 50%);
linear-gradient(
135deg,
var(--non-button-control-text-color) 50%,
transparent 50%
);
}

.dusk-select,
.dusk-select option {
color: var(--control-text-color);
color: var(--non-button-control-text-color);
}

.dusk-select:disabled {
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/lib/stores/appStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const networks = [

const browserDefaults = browser
? {
darkMode: window.matchMedia("(prefers-color-scheme: dark)").matches
darkMode: window.matchMedia("(prefers-color-scheme: dark)").matches,
}
: {
darkMode: false
darkMode: false,
};

/** @type {AppStoreContent} */
Expand Down
9 changes: 5 additions & 4 deletions explorer/src/routes/__tests__/layout.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { afterEach, describe, expect, it } from "vitest";
import { cleanup, fireEvent } from "@testing-library/svelte";
import { get } from "svelte/store";
import { appStore } from "$lib/stores";
Expand All @@ -9,7 +9,7 @@ import MainLayout from "../+layout.svelte";

describe("Main layout", () => {
const baseOptions = { props: {}, target: document.body };

afterEach(() => {
cleanup();
});
Expand All @@ -36,7 +36,8 @@ describe("Main layout", () => {

it('should add and remove the "dark" class name to the `html` element when the `darkMode` value changes in the settings store', async () => {
const isDarkMode = () => get(appStore).darkMode;
const hasDarkClass = () => document.documentElement.classList.contains("dark");
const hasDarkClass = () =>
document.documentElement.classList.contains("dark");

expect(isDarkMode()).toBe(false);
expect(hasDarkClass()).toBe(false);
Expand All @@ -51,4 +52,4 @@ describe("Main layout", () => {
expect(isDarkMode()).toBe(false);
expect(hasDarkClass()).toBe(false);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`Blocks page > should render the Blocks page, start polling for blocks a
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down Expand Up @@ -63,7 +63,7 @@ exports[`Blocks page > should render the Blocks page, start polling for blocks a
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`Transactions page > should render the Transactions page, start polling
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
disabled=""
type="button"
>
Expand Down Expand Up @@ -63,7 +63,7 @@ exports[`Transactions page > should render the Transactions page, start polling
</h1>
<button
class="dusk-button dusk-button--type--button dusk-button--variant--secondary dusk-button--size--normal"
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--normal"
type="button"
>
<span
Expand Down
33 changes: 14 additions & 19 deletions explorer/src/style/dusk/language.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:root {
/* Theme colours */

--page-background-color: var(--light-grey);
--page-background-color: var(--smokey-black);
--background-color: var(--light-grey);
--background-color-alt: #fff;
--primary-color: var(--smokey-black);
Expand Down Expand Up @@ -56,30 +56,27 @@
--non-button-control-bg-color: #fff;
--non-button-control-text-color: var(--smokey-black);

--control-bg-color: #fff;
--control-bg-color-hover: var(--silver-metallic);
--control-bg-color: var(--smokey-black);
--control-bg-color-hover: var(--cornflower);
--control-border-color: transparent;
--control-border-color-hover: transparent;
--control-text-color: var(--smokey-black);
--control-text-color: #fff;
--control-text-color-hover: var(--smokey-black);

--control-secondary-bg-color: var(--smokey-black);
--control-secondary-bg-color-hover: var(--cornflower);
--control-secondary-bg-color: #fff;
--control-secondary-bg-color-hover: var(--silver-metallic);
--control-secondary-border-color: transparent;
--control-secondary-border-color-hover: transparent;
--control-secondary-text-color: #fff;
--control-secondary-text-color-hover: var(--smokey-black);
--control-secondary-text-color: var(--smokey-black);

--control-tertiary-bg-color: transparent;
--control-tertiary-bg-color-hover: var(--cornflower);
--control-tertiary-border-color: var(--smokey-black);
--control-tertiary-border-color-hover: var(--cornflower);
--control-tertiary-text-color: var(--smokey-black);
--control-tertiary-text-color-hover: var(--smokey-black);

/* Anchors */

--anchor-color-on-surface: var(--accent-light-900);
--anchor-color: var(--secondary-color);
--anchor-color-visited: var(--secondary-color);
--anchor-color-hover: var(--secondary-color-variant-light);
Expand Down Expand Up @@ -117,17 +114,15 @@
--on-primary-color: var(--smokey-black);
--on-surface-color: var(--light-grey);

/* Anchors */
--anchor-color-on-surface: var(--accent-dark-900);

/* Controls */

--control-bg-color: var(--smokey-black);
--control-bg-color-hover: var(--jet);
--control-text-color: var(--light-grey);
--control-text-color-hover: var(--light-grey);
--control-secondary-bg-color: var(--light-grey);
--control-secondary-text-color: var(--smokey-black);
--non-button-control-bg-color: var(--smokey-black);
--non-button-control-text-color: var(--light-grey);

--control-bg-color: var(--light-grey);
--control-text-color: var(--smokey-black);
--control-secondary-bg-color: var(--smokey-black);
--control-secondary-text-color: var(--light-grey);
--control-tertiary-border-color: var(--light-grey);
--control-tertiary-text-color: var(--light-grey);

Expand Down

0 comments on commit 46cb763

Please sign in to comment.