From 8f0f8f9af8db2d9f85b499da828b9ab7ade5cf5d Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Tue, 13 Apr 2021 16:49:47 +0200 Subject: [PATCH] Use graphs-base and congrats-base --- qt/aqt/data/web/css/BUILD.bazel | 1 - qt/aqt/data/web/css/vendor/BUILD.bazel | 17 ----------------- qt/aqt/data/web/pages/BUILD.bazel | 2 ++ ts/congrats/BUILD.bazel | 15 ++++++++++++--- ts/congrats/CongratsPage.svelte | 2 -- ts/congrats/congrats-base.scss | 6 ++++++ ts/congrats/congrats.html | 1 + ts/graphs/BUILD.bazel | 9 ++++++++- ts/graphs/GraphsPage.svelte | 2 -- ts/graphs/graphs-base.scss | 6 ++++++ ts/graphs/graphs.html | 1 + ts/sass/_base.scss | 4 ++-- ts/sass/card_counts.scss | 8 ++++---- 13 files changed, 42 insertions(+), 32 deletions(-) delete mode 100644 qt/aqt/data/web/css/vendor/BUILD.bazel create mode 100644 ts/congrats/congrats-base.scss create mode 100644 ts/graphs/graphs-base.scss diff --git a/qt/aqt/data/web/css/BUILD.bazel b/qt/aqt/data/web/css/BUILD.bazel index f27b9d463..ff0045e68 100644 --- a/qt/aqt/data/web/css/BUILD.bazel +++ b/qt/aqt/data/web/css/BUILD.bazel @@ -32,7 +32,6 @@ filegroup( "core.css", "css_local", "editor", - "//qt/aqt/data/web/css/vendor", ], visibility = ["//qt:__subpackages__"], ) diff --git a/qt/aqt/data/web/css/vendor/BUILD.bazel b/qt/aqt/data/web/css/vendor/BUILD.bazel deleted file mode 100644 index 591f16a5c..000000000 --- a/qt/aqt/data/web/css/vendor/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("//ts:vendor.bzl", "copy_bootstrap_css") - -copy_bootstrap_css(name = "bootstrap") - -files = [ - "bootstrap", -] - -directories = [] - -filegroup( - name = "vendor", - srcs = glob(["*.css"]) + - ["//qt/aqt/data/web/css/vendor:{}".format(file) for file in files] + - ["//qt/aqt/data/web/css/vendor/{}".format(dir) for dir in directories], - visibility = ["//qt:__subpackages__"], -) diff --git a/qt/aqt/data/web/pages/BUILD.bazel b/qt/aqt/data/web/pages/BUILD.bazel index 0140a7e8f..cf5066349 100644 --- a/qt/aqt/data/web/pages/BUILD.bazel +++ b/qt/aqt/data/web/pages/BUILD.bazel @@ -3,6 +3,7 @@ load("//ts:copy.bzl", "copy_files_into_group") copy_files_into_group( name = "graphs_page", srcs = [ + "graphs-base.css", "graphs.css", "graphs.html", "graphs.js", @@ -13,6 +14,7 @@ copy_files_into_group( copy_files_into_group( name = "congrats_page", srcs = [ + "congrats-base.css", "congrats.css", "congrats.html", "congrats.js", diff --git a/ts/congrats/BUILD.bazel b/ts/congrats/BUILD.bazel index cf72428fe..a5f27dbd8 100644 --- a/ts/congrats/BUILD.bazel +++ b/ts/congrats/BUILD.bazel @@ -3,12 +3,20 @@ load("//ts:prettier.bzl", "prettier_test") load("//ts:eslint.bzl", "eslint_test") load("//ts/svelte:svelte.bzl", "svelte", "svelte_check") load("//ts:esbuild.bzl", "esbuild") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") + +sass_binary( + name = "base_css", + src = "congrats-base.scss", + visibility = ["//visibility:public"], +) svelte( name = "CongratsPage", entry_point = "CongratsPage.svelte", ) + ts_library( name = "index", srcs = ["index.ts"], @@ -16,6 +24,7 @@ ts_library( "CongratsPage", "lib", "//ts/lib", + "@npm//svelte", "@npm//svelte2tsx", ], ) @@ -47,11 +56,11 @@ esbuild( output_css = True, visibility = ["//visibility:public"], deps = [ - "CongratsPage", - "index", "//ts/lib", "//ts/lib:backend_proto", - "//ts/sass:core_css", + "CongratsPage", + ":index", + ":base_css", ], ) diff --git a/ts/congrats/CongratsPage.svelte b/ts/congrats/CongratsPage.svelte index 4f7e01c9e..5367bb64b 100644 --- a/ts/congrats/CongratsPage.svelte +++ b/ts/congrats/CongratsPage.svelte @@ -3,8 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> diff --git a/ts/graphs/BUILD.bazel b/ts/graphs/BUILD.bazel index aa2aea72a..2d34efbe0 100644 --- a/ts/graphs/BUILD.bazel +++ b/ts/graphs/BUILD.bazel @@ -3,6 +3,13 @@ load("//ts/svelte:svelte.bzl", "compile_svelte", "svelte_check") load("//ts:prettier.bzl", "prettier_test") load("//ts:eslint.bzl", "eslint_test") load("//ts:esbuild.bzl", "esbuild") +load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") + +sass_binary( + name = "base_css", + src = "graphs-base.scss", + visibility = ["//visibility:public"], +) svelte_files = glob(["*.svelte"]) @@ -67,7 +74,7 @@ esbuild( "//ts/lib", "//ts/lib:backend_proto", ":index", - "//ts/sass:core_css", + ":base_css", ] + svelte_names, ) diff --git a/ts/graphs/GraphsPage.svelte b/ts/graphs/GraphsPage.svelte index 18ba6fa0e..9df8d38ad 100644 --- a/ts/graphs/GraphsPage.svelte +++ b/ts/graphs/GraphsPage.svelte @@ -3,8 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> diff --git a/ts/sass/_base.scss b/ts/sass/_base.scss index 226db3e55..0bf9582d5 100644 --- a/ts/sass/_base.scss +++ b/ts/sass/_base.scss @@ -7,8 +7,8 @@ $font-weight-base: 500; $link-hover-color: var(--link); $link-hover-decoration: none; -@import 'ts/node_modules/bootstrap/scss/bootstrap-reboot'; -@import 'ts/node_modules/bootstrap/scss/bootstrap-utilities'; +@import "ts/node_modules/bootstrap/scss/bootstrap-reboot"; +@import "ts/node_modules/bootstrap/scss/bootstrap-utilities"; body { overscroll-behavior: none; diff --git a/ts/sass/card_counts.scss b/ts/sass/card_counts.scss index 93296e3e1..86bb2a520 100644 --- a/ts/sass/card_counts.scss +++ b/ts/sass/card_counts.scss @@ -1,15 +1,15 @@ .review-count { - color: var(--review-count); + color: var(--review-count); } .new-count { - color: var(--new-count); + color: var(--new-count); } .learn-count { - color: var(--learn-count); + color: var(--learn-count); } .zero-count { - color: var(--zero-count); + color: var(--zero-count); }