diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index d52453c..3611445 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -7,15 +7,25 @@ on: pull_request: types: [opened, synchronize, reopened] +env: + DART_SASS_VERSION: 1.79.6 + jobs: compile: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Install Dependencies + - name: Install Dart Sass + uses: robinraju/release-downloader@v1 + with: + repository: 'sass/dart-sass' + tag: ${{ env.DART_SASS_VERSION }} + fileName: "dart-sass-${{ env.DART_SASS_VERSION }}-linux-x64.tar.gz" + extract: true + - name: Add Binary to PATH run: | - sudo apt install ruby sass -y + echo "$GITHUB_WORKSPACE/dart-sass" >> "$GITHUB_PATH" - name: Compile run: | cd ./src; make diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f080c58..90e3933 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,26 @@ on: tags: - v* +env: + DART_SASS_VERSION: 1.79.6 + jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - - name: Install Dependencies + - name: Install Dart Sass + uses: robinraju/release-downloader@v1 + with: + repository: 'sass/dart-sass' + tag: ${{ env.DART_SASS_VERSION }} + fileName: "dart-sass-${{ env.DART_SASS_VERSION }}-linux-x64.tar.gz" + extract: true + - name: Add Binary to PATH run: | - sudo apt install ruby sass -y - - name: Compile + echo "$GITHUB_WORKSPACE/dart-sass" >> "$GITHUB_PATH" + - name: Compile run: | cd ./src; make all-and-compress - name: Release diff --git a/src/Makefile b/src/Makefile index 5928e02..ad25461 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,9 +19,9 @@ define build mkdir -p $(target_dir)/$(1)-$(2) mkdir -p $(target_dir)/$(1)-$(2)/target if [ "$(3)" = "light" ]; then \ - scss --sourcemap=none --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex.css; \ + sass --no-source-map --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex.css; \ else \ - scss --sourcemap=none --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex-$(3).css; \ + sass --no-source-map --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex-$(3).css; \ fi endef diff --git a/src/scss/settings.scss b/src/scss/settings.scss index d694ccb..42485e7 100644 --- a/src/scss/settings.scss +++ b/src/scss/settings.scss @@ -1,22 +1,27 @@ :root { + $ui-font: null; + $heading-Chinese-font: null; + $chapter-Chinese-font: null; + $sub-chapter-Chinese-font: null; + $sub-sub-chapter-Chinese-font: null; @if $os == "windows" { - $ui-font: "\"阿里巴巴普惠体 2.0\"", "\"微软雅黑\"" !global; - $heading-Chinese-font: "华文黑体" !global; - $chapter-Chinese-font: "华文黑体" !global; - $sub-chapter-Chinese-font: "华文楷体" !global; - $sub-sub-chapter-Chinese-font: "华文仿宋" !global; + $ui-font: "\"阿里巴巴普惠体 2.0\"", "\"微软雅黑\""; + $heading-Chinese-font: "华文黑体"; + $chapter-Chinese-font: "华文黑体"; + $sub-chapter-Chinese-font: "华文楷体"; + $sub-sub-chapter-Chinese-font: "华文仿宋"; } @else if $os == "macos" { - $ui-font: "\"苹方-简\"" !global; - $heading-Chinese-font: "华文黑体Bold" !global; - $chapter-Chinese-font: "方正公文黑体" !global; - $sub-chapter-Chinese-font: "方正公文楷体" !global; - $sub-sub-chapter-Chinese-font: "方正公文仿宋" !global; + $ui-font: "\"苹方-简\""; + $heading-Chinese-font: "华文黑体Bold"; + $chapter-Chinese-font: "方正公文黑体"; + $sub-chapter-Chinese-font: "方正公文楷体"; + $sub-sub-chapter-Chinese-font: "方正公文仿宋"; } @else if $os == "linux" { - $ui-font: "\"Noto Sans CJK SC\"" !global; - $heading-Chinese-font: "Noto Sans CJK SC" !global; - $chapter-Chinese-font: "Noto Sans CJK SC" !global; - $sub-chapter-Chinese-font: "Noto Serif CJK SC" !global; - $sub-sub-chapter-Chinese-font: "Noto Serif CJK SC" !global; + $ui-font: "\"Noto Sans CJK SC\""; + $heading-Chinese-font: "Noto Sans CJK SC"; + $chapter-Chinese-font: "Noto Sans CJK SC"; + $sub-chapter-Chinese-font: "Noto Serif CJK SC"; + $sub-sub-chapter-Chinese-font: "Noto Serif CJK SC"; } /* == 字体设置 == */