formalconf 2.0.13 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/formalconf.js +67 -41
- package/package.json +1 -1
package/dist/formalconf.js
CHANGED
|
@@ -467,7 +467,7 @@ function StatusIndicator({
|
|
|
467
467
|
// package.json
|
|
468
468
|
var package_default = {
|
|
469
469
|
name: "formalconf",
|
|
470
|
-
version: "2.0.
|
|
470
|
+
version: "2.0.15",
|
|
471
471
|
description: "Dotfiles management TUI for macOS and Linux - config management, package sync, and theme switching",
|
|
472
472
|
type: "module",
|
|
473
473
|
main: "./dist/formalconf.js",
|
|
@@ -4828,8 +4828,7 @@ function darken(hex, percent) {
|
|
|
4828
4828
|
}
|
|
4829
4829
|
function createColloidPalette(palette, mode) {
|
|
4830
4830
|
const isDark = mode === "dark";
|
|
4831
|
-
const
|
|
4832
|
-
const orderedGrey = isDark ? grey : [...grey].reverse();
|
|
4831
|
+
const orderedGrey = isDark ? interpolateGreyscale(palette.foreground, palette.background) : interpolateGreyscale(palette.background, palette.foreground);
|
|
4833
4832
|
const accentBase = palette.accent || palette.color4;
|
|
4834
4833
|
return {
|
|
4835
4834
|
grey: orderedGrey,
|
|
@@ -4867,6 +4866,8 @@ function createColloidPalette(palette, mode) {
|
|
|
4867
4866
|
}
|
|
4868
4867
|
function generateColloidScss(palette, mode) {
|
|
4869
4868
|
const colloid = createColloidPalette(palette, mode);
|
|
4869
|
+
const orange = interpolateColor(palette.color1, palette.color3, 0.5);
|
|
4870
|
+
const pink = interpolateColor(palette.color1, palette.color5, 0.4);
|
|
4870
4871
|
const greyNames = [
|
|
4871
4872
|
"050",
|
|
4872
4873
|
"100",
|
|
@@ -4891,41 +4892,62 @@ function generateColloidScss(palette, mode) {
|
|
|
4891
4892
|
let scss = `// FormalConf Generated Color Palette
|
|
4892
4893
|
// Auto-generated - do not edit manually
|
|
4893
4894
|
|
|
4894
|
-
//
|
|
4895
|
+
// Red
|
|
4896
|
+
$red-light: ${colloid.red.light};
|
|
4897
|
+
$red-dark: ${colloid.red.dark};
|
|
4898
|
+
|
|
4899
|
+
// Pink
|
|
4900
|
+
$pink-light: ${lighten(pink, 10)};
|
|
4901
|
+
$pink-dark: ${darken(pink, 10)};
|
|
4902
|
+
|
|
4903
|
+
// Purple
|
|
4904
|
+
$purple-light: ${colloid.purple.light};
|
|
4905
|
+
$purple-dark: ${colloid.purple.dark};
|
|
4906
|
+
|
|
4907
|
+
// Blue
|
|
4908
|
+
$blue-light: ${colloid.blue.light};
|
|
4909
|
+
$blue-dark: ${colloid.blue.dark};
|
|
4910
|
+
|
|
4911
|
+
// Teal
|
|
4912
|
+
$teal-light: ${colloid.teal.light};
|
|
4913
|
+
$teal-dark: ${colloid.teal.dark};
|
|
4914
|
+
|
|
4915
|
+
// Green
|
|
4916
|
+
$green-light: ${colloid.green.light};
|
|
4917
|
+
$green-dark: ${colloid.green.dark};
|
|
4918
|
+
|
|
4919
|
+
// Yellow
|
|
4920
|
+
$yellow-light: ${colloid.yellow.light};
|
|
4921
|
+
$yellow-dark: ${colloid.yellow.dark};
|
|
4922
|
+
|
|
4923
|
+
// Orange
|
|
4924
|
+
$orange-light: ${lighten(orange, 10)};
|
|
4925
|
+
$orange-dark: ${darken(orange, 10)};
|
|
4926
|
+
|
|
4927
|
+
// Grey
|
|
4895
4928
|
`;
|
|
4896
4929
|
for (let i = 0;i < greyNames.length; i++) {
|
|
4897
4930
|
scss += `$grey-${greyNames[i]}: ${colloid.grey[i]};
|
|
4898
4931
|
`;
|
|
4899
4932
|
}
|
|
4900
4933
|
scss += `
|
|
4901
|
-
//
|
|
4902
|
-
$black: ${colloid.black};
|
|
4934
|
+
// White
|
|
4903
4935
|
$white: ${colloid.white};
|
|
4904
4936
|
|
|
4905
|
-
//
|
|
4906
|
-
$
|
|
4907
|
-
$green-dark: ${colloid.green.dark};
|
|
4908
|
-
$yellow-dark: ${colloid.yellow.dark};
|
|
4909
|
-
$blue-dark: ${colloid.blue.dark};
|
|
4910
|
-
$purple-dark: ${colloid.purple.dark};
|
|
4911
|
-
$teal-dark: ${colloid.teal.dark};
|
|
4937
|
+
// Black
|
|
4938
|
+
$black: ${colloid.black};
|
|
4912
4939
|
|
|
4913
|
-
//
|
|
4914
|
-
$
|
|
4915
|
-
$
|
|
4916
|
-
$
|
|
4917
|
-
$blue-light: ${colloid.blue.light};
|
|
4918
|
-
$purple-light: ${colloid.purple.light};
|
|
4919
|
-
$teal-light: ${colloid.teal.light};
|
|
4940
|
+
// Button (window controls)
|
|
4941
|
+
$button-close: ${palette.color1};
|
|
4942
|
+
$button-max: ${palette.color2};
|
|
4943
|
+
$button-min: ${palette.color3};
|
|
4920
4944
|
|
|
4921
|
-
//
|
|
4922
|
-
$default-dark: ${colloid.accent.dark};
|
|
4923
|
-
$default-light: ${colloid.accent.light};
|
|
4945
|
+
// Link
|
|
4924
4946
|
$links: ${palette.accent || palette.color4};
|
|
4925
4947
|
|
|
4926
|
-
//
|
|
4927
|
-
$
|
|
4928
|
-
$
|
|
4948
|
+
// Theme (accent color)
|
|
4949
|
+
$default-light: ${colloid.accent.light};
|
|
4950
|
+
$default-dark: ${colloid.accent.dark};
|
|
4929
4951
|
`;
|
|
4930
4952
|
return scss;
|
|
4931
4953
|
}
|
|
@@ -4987,6 +5009,7 @@ async function cloneColloidRepo() {
|
|
|
4987
5009
|
return result.success;
|
|
4988
5010
|
}
|
|
4989
5011
|
async function updateColloidRepo() {
|
|
5012
|
+
await exec(["git", "checkout", "--", "src/sass/_color-palette-default.scss"], COLLOID_DIR);
|
|
4990
5013
|
const result = await exec(["git", "pull", "--rebase"], COLLOID_DIR);
|
|
4991
5014
|
return result.success;
|
|
4992
5015
|
}
|
|
@@ -4998,21 +5021,9 @@ async function ensureColloidRepo() {
|
|
|
4998
5021
|
}
|
|
4999
5022
|
async function writeCustomPalette(palette, mode) {
|
|
5000
5023
|
const scss = generateColloidScss(palette, mode);
|
|
5001
|
-
const palettePath = join6(COLLOID_DIR, "src", "sass", "_color-palette-
|
|
5024
|
+
const palettePath = join6(COLLOID_DIR, "src", "sass", "_color-palette-default.scss");
|
|
5002
5025
|
await writeFile(palettePath, scss);
|
|
5003
5026
|
}
|
|
5004
|
-
async function patchTweaksFile(themeName) {
|
|
5005
|
-
const tweaksContent = `// FormalConf theme: ${themeName}
|
|
5006
|
-
// Auto-patched to use custom color palette
|
|
5007
|
-
|
|
5008
|
-
@import 'color-palette-formalconf';
|
|
5009
|
-
|
|
5010
|
-
$tweaks: true;
|
|
5011
|
-
$colorscheme: true;
|
|
5012
|
-
`;
|
|
5013
|
-
const tweaksPath = join6(COLLOID_DIR, "src", "sass", "_tweaks-temp.scss");
|
|
5014
|
-
await writeFile(tweaksPath, tweaksContent);
|
|
5015
|
-
}
|
|
5016
5027
|
async function runColloidInstall(options) {
|
|
5017
5028
|
const args = [
|
|
5018
5029
|
"./install.sh",
|
|
@@ -5024,12 +5035,15 @@ async function runColloidInstall(options) {
|
|
|
5024
5035
|
if (options.installLibadwaita !== false) {
|
|
5025
5036
|
args.push("-l");
|
|
5026
5037
|
}
|
|
5038
|
+
if (options.mode === "dark") {
|
|
5039
|
+
args.push("--tweaks", "black");
|
|
5040
|
+
}
|
|
5027
5041
|
const result = await exec(args, COLLOID_DIR);
|
|
5028
5042
|
return result.exitCode;
|
|
5029
5043
|
}
|
|
5030
5044
|
function getGtkThemeName(themeName, mode) {
|
|
5031
5045
|
const modeCapitalized = mode === "dark" ? "Dark" : "Light";
|
|
5032
|
-
return `
|
|
5046
|
+
return `formalconf-${themeName}-${modeCapitalized}`;
|
|
5033
5047
|
}
|
|
5034
5048
|
async function applyGtkTheme(theme, mode) {
|
|
5035
5049
|
if (getOS() !== "linux") {
|
|
@@ -5068,7 +5082,6 @@ ${instructions}`
|
|
|
5068
5082
|
};
|
|
5069
5083
|
}
|
|
5070
5084
|
await writeCustomPalette(palette, mode);
|
|
5071
|
-
await patchTweaksFile(themeName);
|
|
5072
5085
|
const gtkConfig = theme.gtk || {};
|
|
5073
5086
|
const options = {
|
|
5074
5087
|
themeName,
|
|
@@ -5616,6 +5629,11 @@ function getContextValue(context, variableName, modifier) {
|
|
|
5616
5629
|
const value = context.theme[key];
|
|
5617
5630
|
return value !== undefined ? String(value) : undefined;
|
|
5618
5631
|
}
|
|
5632
|
+
if (variableName.startsWith("gtk.")) {
|
|
5633
|
+
const key = variableName.slice(4);
|
|
5634
|
+
const value = context.gtk[key];
|
|
5635
|
+
return value !== undefined ? String(value) : undefined;
|
|
5636
|
+
}
|
|
5619
5637
|
if (variableName === "mode") {
|
|
5620
5638
|
return context.mode;
|
|
5621
5639
|
}
|
|
@@ -5908,6 +5926,13 @@ function buildThemeMetadata(theme, mode) {
|
|
|
5908
5926
|
mode
|
|
5909
5927
|
};
|
|
5910
5928
|
}
|
|
5929
|
+
function buildGtkMetadata(theme, mode) {
|
|
5930
|
+
const themeName = theme.title.toLowerCase().replace(/\s+/g, "-");
|
|
5931
|
+
const modeCapitalized = mode === "dark" ? "Dark" : "Light";
|
|
5932
|
+
return {
|
|
5933
|
+
theme: `formalconf-${themeName}-${modeCapitalized}`
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5911
5936
|
function buildTemplateContext(theme, palette, mode) {
|
|
5912
5937
|
return {
|
|
5913
5938
|
color0: hexToColorVariable(palette.color0),
|
|
@@ -5934,6 +5959,7 @@ function buildTemplateContext(theme, palette, mode) {
|
|
|
5934
5959
|
accent: hexToColorVariableOrDefault(palette.accent, palette.color4),
|
|
5935
5960
|
border: hexToColorVariableOrDefault(palette.border, palette.color0),
|
|
5936
5961
|
theme: buildThemeMetadata(theme, mode),
|
|
5962
|
+
gtk: buildGtkMetadata(theme, mode),
|
|
5937
5963
|
mode
|
|
5938
5964
|
};
|
|
5939
5965
|
}
|
package/package.json
CHANGED