Skip to content

Commit

Permalink
fix a breaking error and release (sad it lasted that long)
Browse files Browse the repository at this point in the history
  • Loading branch information
KTibow committed Dec 15, 2024
1 parent 778e219 commit 19465aa
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 62 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "m3-svelte",
"version": "3.4.4",
"version": "3.4.5",
"license": "Apache-2.0 OR GPL-3.0-only",
"repository": "KTibow/m3-svelte",
"author": {
Expand Down Expand Up @@ -37,7 +37,6 @@
}
},
"devDependencies": {
"@material/material-color-utilities": "^0.3.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.11.1",
"@sveltejs/package": "^2.3.7",
Expand All @@ -60,6 +59,7 @@
"dependencies": {
"@iconify/types": "^2.0.0",
"@ktibow/iconset-material-symbols": "^0.0.1732258297",
"@material/material-color-utilities": "^0.3.0",
"svelte": "^5.3.0"
},
"files": [
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 1 addition & 56 deletions src/lib/misc/serializeScheme.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
import { DynamicScheme, MaterialDynamicColors } from "@material/material-color-utilities";
import type { Color, SerializedScheme } from "./utils";

export const pairs = [
["primary", "onPrimary"],
["primaryContainer", "onPrimaryContainer"],
["secondary", "onSecondary"],
["secondaryContainer", "onSecondaryContainer"],
["tertiary", "onTertiary"],
["tertiaryContainer", "onTertiaryContainer"],
["background", "onBackground"],
["surface", "onSurface"],
["inverseSurface", "inverseOnSurface"],
["surfaceVariant", "onSurfaceVariant"],
["error", "onError"],
["errorContainer", "onErrorContainer"],
];

export const colors: Color[] = [
"primary",
"onPrimary",
"primaryContainer",
"onPrimaryContainer",
"inversePrimary",
"secondary",
"onSecondary",
"secondaryContainer",
"onSecondaryContainer",
"tertiary",
"onTertiary",
"tertiaryContainer",
"onTertiaryContainer",
"error",
"onError",
"errorContainer",
"onErrorContainer",
"background",
"onBackground",
"surface",
"onSurface",
"surfaceVariant",
"onSurfaceVariant",
"inverseSurface",
"inverseOnSurface",
"outline",
"outlineVariant",
"shadow",
"scrim",
"surfaceDim",
"surfaceBright",
"surfaceContainerLowest",
"surfaceContainerLow",
"surfaceContainer",
"surfaceContainerHigh",
"surfaceContainerHighest",
"surfaceTint",
];
import { colors, type SerializedScheme } from "./utils";

/**
* @description Serializes the {@link DynamicScheme} so that it can be used by {@link StyleFromScheme} and {@link genCSS}.
Expand Down
55 changes: 55 additions & 0 deletions src/lib/misc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,61 @@ export type Color =
| "surfaceTint";
export type SerializedScheme = Record<Color, number>;

export const pairs = [
["primary", "onPrimary"],
["primaryContainer", "onPrimaryContainer"],
["secondary", "onSecondary"],
["secondaryContainer", "onSecondaryContainer"],
["tertiary", "onTertiary"],
["tertiaryContainer", "onTertiaryContainer"],
["background", "onBackground"],
["surface", "onSurface"],
["inverseSurface", "inverseOnSurface"],
["surfaceVariant", "onSurfaceVariant"],
["error", "onError"],
["errorContainer", "onErrorContainer"],
];

export const colors: Color[] = [
"primary",
"onPrimary",
"primaryContainer",
"onPrimaryContainer",
"inversePrimary",
"secondary",
"onSecondary",
"secondaryContainer",
"onSecondaryContainer",
"tertiary",
"onTertiary",
"tertiaryContainer",
"onTertiaryContainer",
"error",
"onError",
"errorContainer",
"onErrorContainer",
"background",
"onBackground",
"surface",
"onSurface",
"surfaceVariant",
"onSurfaceVariant",
"inverseSurface",
"inverseOnSurface",
"outline",
"outlineVariant",
"shadow",
"scrim",
"surfaceDim",
"surfaceBright",
"surfaceContainerLowest",
"surfaceContainerLow",
"surfaceContainer",
"surfaceContainerHigh",
"surfaceContainerHighest",
"surfaceTint",
];

/**
* @returns A string of CSS code with custom properties representing the color scheme values.
* */
Expand Down
3 changes: 2 additions & 1 deletion src/routes/theme/SchemeShowcase.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import StyleFromScheme from "$lib/misc/StyleFromScheme.svelte";
import Button from "$lib/buttons/Button.svelte";
import ColorCard from "./ColorCard.svelte";
import { pairs, serializeScheme } from "$lib/misc/serializeScheme";
import { pairs } from "$lib/misc/utils";
import { serializeScheme } from "$lib/misc/serializeScheme";
export let schemeLight: DynamicScheme;
export let schemeDark: DynamicScheme;
Expand Down

0 comments on commit 19465aa

Please sign in to comment.