Skip to content

Commit

Permalink
fix(nix): accent color wasn't applying correctly (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston authored Dec 2, 2023
1 parent b40146f commit 2f13f50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This means that you will have to either:
programs.vscode.extensions = [
# all the theme options will be available as overrides, these are defaults:
(pkgs.catppuccin-vsc.override {
accentColor = "mauve";
accent = "mauve";
boldKeywords = true;
italicComments = true;
italicKeywords = true;
Expand Down
6 changes: 4 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
pkgs ? import <nixpkgs> {},
accentColor ? "mauve",
accentColor ? null,
accent ? "mauve",
boldKeywords ? true,
italicComments ? true,
italicKeywords ? true,
Expand Down Expand Up @@ -76,7 +77,8 @@
'';
};
in
(lib.checkListOfEnum "${pname}: accent" validAccents [accentColor])
(lib.throwIfNot (accentColor == null) "${pname}: deprecated option 'accentColor' is no longer supported, please use 'accent' instead.")
(lib.checkListOfEnum "${pname}: accent" validAccents [accent])
(lib.checkListOfEnum "${pname}: workbenchMode" validWorkbenchModes [workbenchMode])
(lib.checkListOfEnum "${pname}: bracketMode" validBracketModes [bracketMode])
pkgs.vscode-utils.buildVscodeMarketplaceExtension {
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/generateThemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ const flavors = Object.keys(variants) as CatppuccinFlavor[];

// options can also be passed as a JSON string as an environment variable
const optEnvVar = process.env.CATPPUCCIN_OPTIONS;
const options = optEnvVar ? JSON.parse(optEnvVar) : {};
const optEnv = optEnvVar ? JSON.parse(optEnvVar) : {};

const main = async () => {
await mkdir(join(repoRoot, "themes"), { recursive: true });

flavors.map((flavor) => {
const theme = compileTheme(flavor, { ...defaultOptions, ...options });
const options = { ...defaultOptions, ...optEnv };
const theme = compileTheme(flavor, options);
writeFile(
join(repoRoot, `themes/${flavor}.json`),
JSON.stringify(theme, null, 2),
Expand Down

0 comments on commit 2f13f50

Please sign in to comment.