Skip to content

Commit

Permalink
🎯 fix dart-sass forever
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshix-1 committed Sep 20, 2024
1 parent 41bd55b commit f66938b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 27 deletions.
31 changes: 8 additions & 23 deletions .github/actions/install_dart_sass/action.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
name: Install dart-sass
description: Install dart-sass
inputs:
version:
description: The version of dart-sass
tar_gz_release_file:
description: The .tar.gz release file.
required: false
default: 1.79.1
default: https://github.com/asozialesnetzwerk/dart-sass/releases/download/1.79.2%2Basozial/dart-sass-1.79.2+asozial-linux-x64.tar.gz
runs:
using: composite
steps:
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 3.4.0
- name: Install buf
shell: bash
run: |
wget -O /usr/local/bin/buf "https://github.com/bufbuild/buf/releases/download/v1.32.2/buf-$(uname -s)-$(uname -m)"
chmod +x /usr/local/bin/buf
- name: Install dart-sass
shell: bash
run: |
pushd /tmp
wget https://github.com/sass/dart-sass/archive/refs/tags/${{ inputs.version }}.tar.gz
tar xf ${{ inputs.version }}.tar.gz
cd dart-sass-${{ inputs.version }}
dart pub add dev:analyzer:6.5.0
dart pub get
dart run grinder protobuf
sed -i "s/math.Random()/math.Random(0)/" lib/src/functions/*.dart
dart compile exe bin/sass.dart --output /usr/local/bin/dart-sass
cd ..
rm -fr ${{ inputs.version }}.tar.gz dart-sass-${{ inputs.version }}
pushd "$(mktemp -d)"
wget "${{ inputs.tar_gz_release_file }}"
tar xf *.tar.gz
rm *.tar.gz
mv ./dart-sass/* /usr/local/bin/
popd
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install dart-sass
uses: ./.github/actions/install_dart_sass
- name: Generate snow
run: dart-sass -s compressed style/snow.scss style/snow.css
run: sass -s compressed --random-seed 0 style/snow.scss style/snow.css
- name: Build JS & CSS
run: deno task clean && deno task build
- name: Generate humans.txt
Expand Down
2 changes: 1 addition & 1 deletion an_website/static/css/snow.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions style/snow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
$random-x: math.random(1000000) * 0.0001vw;
$random-offset: random-range(-100000, 100000) * 0.0001vw;
$random-x-end: $random-x + $random-offset;
$random-x-end-yoyo: $random-x + ($random-offset / 2);
$random-yoyo-time: random-range(30000, 80000) / 100000;
$random-x-end-yoyo: $random-x + math.div($random-offset, 2);
$random-yoyo-time: math.div(random-range(30000, 80000), 100000);
$random-yoyo-y: $random-yoyo-time * 100vh;
$random-scale: math.random(10000) * 0.0001;
$fall-duration: random-range(10, 30) * 1s;
Expand Down

0 comments on commit f66938b

Please sign in to comment.