use dart-sass instead of sassc

compilation is twice slower but i guess not deprecated is good. style compile is async and ags takes like 1s to start anyway...
This commit is contained in:
end-4
2024-02-23 16:59:48 +07:00
parent 3b4ced6591
commit 1f830307c6
6 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicmaterial.scss'`); //
async function applyStyle() {
const COMPILED_STYLE_DIR = `${GLib.get_user_cache_dir()}/ags/user/generated`
Utils.exec(`mkdir -p ${COMPILED_STYLE_DIR}`);
Utils.exec(`sassc ${App.configDir}/scss/main.scss ${COMPILED_STYLE_DIR}/style.css`);
Utils.exec(`sass ${App.configDir}/scss/main.scss ${COMPILED_STYLE_DIR}/style.css`);
App.resetCss();
App.applyCss(`${COMPILED_STYLE_DIR}/style.css`);
console.log('[LOG] Styles loaded')
@@ -213,7 +213,7 @@ const CoverArt = ({ player, ...rest }) => {
.then(() => {
exec(`wal -i "${player.coverPath}" -n -t -s -e -q ${lightDark}`)
exec(`cp ${GLib.get_user_cache_dir()}/wal/colors.scss ${App.configDir}/scss/_musicwal.scss`);
exec(`sassc ${App.configDir}/scss/_music.scss ${stylePath}`);
exec(`sass ${App.configDir}/scss/_music.scss ${stylePath}`);
// self.css = `background-image: url('${coverPath}');`;
Utils.timeout(200, () => self.attribute.showImage(self, coverPath));
App.applyCss(`${stylePath}`);
@@ -65,7 +65,7 @@ apply_gtklock() {
# Copy template
mkdir -p "$HOME"/.cache/ags/user/generated/gtklock
sassc "scripts/templates/gtklock/main.scss" "$HOME"/.cache/ags/user/generated/gtklock/style.css
sass "scripts/templates/gtklock/main.scss" "$HOME"/.cache/ags/user/generated/gtklock/style.css
cp "$HOME"/.cache/ags/user/generated/gtklock/style.css "$HOME"/.config/gtklock/style.css
}
@@ -188,7 +188,7 @@ apply_gtk() { # Using gradience-cli
}
apply_ags() {
sassc "$HOME"/.config/ags/scss/main.scss "$HOME"/.config/ags/style.css
sass "$HOME"/.config/ags/scss/main.scss "$HOME"/.config/ags/style.css
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
ags run-js "App.resetCss(); App.applyCss('${HOME}/.config/ags/style.css');"
}
@@ -42,7 +42,7 @@ elif [ "$backend" = "pywal" ]; then
cat color_generation/pywal_to_material.scss >> "$HOME"/.cache/ags/user/generated/material_colors.scss
if [ "$2" = "--apply" ]; then
sassc "$HOME"/.cache/ags/user/generated/material_colors.scss "$HOME"/.cache/ags/user/generated/colors_classes.scss --style compact
sass "$HOME"/.cache/ags/user/generated/material_colors.scss "$HOME"/.cache/ags/user/generated/colors_classes.scss --style compact
sed -i "s/ { color//g" "$HOME"/.cache/ags/user/generated/colors_classes.scss
sed -i "s/\./$/g" "$HOME"/.cache/ags/user/generated/colors_classes.scss
sed -i "s/}//g" "$HOME"/.cache/ags/user/generated/colors_classes.scss
+2 -1
View File
@@ -69,7 +69,8 @@ $osk_key_fontsize: 1.091rem;
.osk-key-fn {
min-width: $osk_key_width * 1.005;
min-height: $osk_key_height / 2;
min-height: calc($osk_key_height / 2); // dart-sass
// min-height: $osk_key_height / 2; // sassc
}
.osk-key-tab {
+1 -1
View File
@@ -2,7 +2,7 @@
### PKGs on same line will be send to `yay` together, unless `-f` is specified.
### Basic
coreutils cliphist curl fuzzel rsync wget ripgrep gojq npm meson typescript gjs sassc
coreutils cliphist curl fuzzel rsync wget ripgrep gojq npm meson typescript gjs dart-sass
### Python
# Add `python-setuptools-scm` and `python-wheel` explicitly to fix #197