summaryrefslogtreecommitdiff
path: root/pkgs/astal
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/astal')
-rw-r--r--pkgs/astal/default.nix3
-rw-r--r--pkgs/astal/src/style/style.scss13
-rw-r--r--pkgs/astal/src/style/theme.scss32
-rw-r--r--pkgs/astal/theme.nix33
4 files changed, 42 insertions, 39 deletions
diff --git a/pkgs/astal/default.nix b/pkgs/astal/default.nix
index 73ada9c..dc19a19 100644
--- a/pkgs/astal/default.nix
+++ b/pkgs/astal/default.nix
@@ -2,6 +2,7 @@
pkgs,
inputs,
system,
+ options,
runCommand,
dart-sass,
...
@@ -10,6 +11,7 @@
let
apkgs = inputs.astal.packages.${system};
scss = "${dart-sass}/bin/sass";
+ theme = import ./theme.nix { inherit options; };
in
inputs.astal.lib.mkLuaPackage {
pkgs = pkgs // {
@@ -20,6 +22,7 @@ inputs.astal.lib.mkLuaPackage {
mkdir -p $out
cp -r ${./src}/{*.lua,widget} $out/
cp -r ${./src}/style/* .
+ echo '${theme}' > theme.scss
cat theme.scss style.scss widget/* > main.scss
${scss} main.scss $out/main.css
'';
diff --git a/pkgs/astal/src/style/style.scss b/pkgs/astal/src/style/style.scss
index 77c8b36..7be2b2f 100644
--- a/pkgs/astal/src/style/style.scss
+++ b/pkgs/astal/src/style/style.scss
@@ -8,22 +8,21 @@
}
window {
- color: $text;
+ color: $fg;
font-family: $font-name;
}
button {
- color: $text;
+ color: $fg;
background: $surface-bg;
&:hover {
- color: $hover;
background: $hover-bg;
}
&.primary {
- color: $primary;
- background: $primary-bg;
+ color: $bg;
+ background: $primary;
}
}
@@ -33,7 +32,7 @@ menu {
border-radius: $outer-radius;
menuitem {
- color: $text;
+ color: $fg;
margin: $inner-gap $outer-gap;
padding: $inner-gap;
border-radius: $inner-radius;
@@ -44,7 +43,7 @@ menu {
}
&:disabled {
- color: $subtext;
+ color: darken($fg, 5%);
}
}
diff --git a/pkgs/astal/src/style/theme.scss b/pkgs/astal/src/style/theme.scss
deleted file mode 100644
index 2af74f5..0000000
--- a/pkgs/astal/src/style/theme.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-
-$text: #cdd6f4;
-$subtext: #a6adc8;
-
-$bg: #1e1e2e;
-$surface-bg: #313244;
-
-$hover: $text;
-$hover-bg: #6c7086;
-
-$primary: $bg;
-$primary-bg: #89b4fa;
-
-$success: #a6e3a1;
-$success-bg: $bg;
-
-$warning: #f9e2af;
-$warning-bg: $bg;
-
-$error: #f38ba8;
-$error-bg: $bg;
-
-$border: 2px;
-
-$inner-radius: 4px;
-$outer-radius: 8px;
-
-$inner-gap: 3px;
-$outer-gap: 10px;
-
-$font-name: "JetBrains Mono", "monospace";
-$font-size: 14px;
diff --git a/pkgs/astal/theme.nix b/pkgs/astal/theme.nix
new file mode 100644
index 0000000..1efd1fe
--- /dev/null
+++ b/pkgs/astal/theme.nix
@@ -0,0 +1,33 @@
+{
+ options,
+ ...
+}:
+
+''
+
+$fg: #${options.theme.colors.fg};
+$bg: #${options.theme.colors.bg};
+
+$surface-fg: #${options.theme.colors.surface.fg};
+$surface-bg: #${options.theme.colors.surface.bg};
+
+$hover-fg: #${options.theme.colors.hover.fg};
+$hover-bg: #${options.theme.colors.hover.bg};
+
+$primary: #${options.theme.colors.primary};
+$success: #${options.theme.colors.success};
+$warning: #${options.theme.colors.warning};
+$error: #${options.theme.colors.error};
+
+$border: ${toString options.theme.borderWidth}px;
+
+$inner-radius: ${toString options.theme.innerRadius}px;
+$outer-radius: ${toString options.theme.outerRadius}px;
+
+$inner-gap: ${toString options.theme.innerGap}px;
+$outer-gap: ${toString options.theme.outerGap}px;
+
+$font-name: "${options.theme.font.regular}", "${options.theme.font.monospace}";
+$font-size: ${toString options.theme.font.size}px;
+
+''