Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nix): accent color wasn't applying correctly #238

Merged
merged 1 commit into from
Dec 2, 2023
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: 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