Use graphs-base and congrats-base

This commit is contained in:
Henrik Giesel 2021-04-13 16:49:47 +02:00
parent fee6ee7319
commit 8f0f8f9af8
13 changed files with 42 additions and 32 deletions

View File

@ -32,7 +32,6 @@ filegroup(
"core.css", "core.css",
"css_local", "css_local",
"editor", "editor",
"//qt/aqt/data/web/css/vendor",
], ],
visibility = ["//qt:__subpackages__"], visibility = ["//qt:__subpackages__"],
) )

View File

@ -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__"],
)

View File

@ -3,6 +3,7 @@ load("//ts:copy.bzl", "copy_files_into_group")
copy_files_into_group( copy_files_into_group(
name = "graphs_page", name = "graphs_page",
srcs = [ srcs = [
"graphs-base.css",
"graphs.css", "graphs.css",
"graphs.html", "graphs.html",
"graphs.js", "graphs.js",
@ -13,6 +14,7 @@ copy_files_into_group(
copy_files_into_group( copy_files_into_group(
name = "congrats_page", name = "congrats_page",
srcs = [ srcs = [
"congrats-base.css",
"congrats.css", "congrats.css",
"congrats.html", "congrats.html",
"congrats.js", "congrats.js",

View File

@ -3,12 +3,20 @@ load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test") load("//ts:eslint.bzl", "eslint_test")
load("//ts/svelte:svelte.bzl", "svelte", "svelte_check") load("//ts/svelte:svelte.bzl", "svelte", "svelte_check")
load("//ts:esbuild.bzl", "esbuild") 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( svelte(
name = "CongratsPage", name = "CongratsPage",
entry_point = "CongratsPage.svelte", entry_point = "CongratsPage.svelte",
) )
ts_library( ts_library(
name = "index", name = "index",
srcs = ["index.ts"], srcs = ["index.ts"],
@ -16,6 +24,7 @@ ts_library(
"CongratsPage", "CongratsPage",
"lib", "lib",
"//ts/lib", "//ts/lib",
"@npm//svelte",
"@npm//svelte2tsx", "@npm//svelte2tsx",
], ],
) )
@ -47,11 +56,11 @@ esbuild(
output_css = True, output_css = True,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"CongratsPage",
"index",
"//ts/lib", "//ts/lib",
"//ts/lib:backend_proto", "//ts/lib:backend_proto",
"//ts/sass:core_css", "CongratsPage",
":index",
":base_css",
], ],
) )

View File

@ -3,8 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
--> -->
<script lang="ts"> <script lang="ts">
import "../sass/core.css";
import type pb from "anki/backend_proto"; import type pb from "anki/backend_proto";
import { buildNextLearnMsg } from "./lib"; import { buildNextLearnMsg } from "./lib";
import { bridgeLink } from "anki/bridgecommand"; import { bridgeLink } from "anki/bridgecommand";

View File

@ -0,0 +1,6 @@
@use 'ts/sass/core';
@use 'ts/sass/scrollbar';
.night-mode {
@include scrollbar.night-mode;
}

View File

@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" id="viewport" content="width=device-width" /> <meta name="viewport" id="viewport" content="width=device-width" />
<link href="congrats-base.css" rel="stylesheet" />
<link href="congrats.css" rel="stylesheet" /> <link href="congrats.css" rel="stylesheet" />
<script src="../js/vendor/protobuf.min.js"></script> <script src="../js/vendor/protobuf.min.js"></script>
<script src="congrats.js"></script> <script src="congrats.js"></script>

View File

@ -3,6 +3,13 @@ load("//ts/svelte:svelte.bzl", "compile_svelte", "svelte_check")
load("//ts:prettier.bzl", "prettier_test") load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test") load("//ts:eslint.bzl", "eslint_test")
load("//ts:esbuild.bzl", "esbuild") 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"]) svelte_files = glob(["*.svelte"])
@ -67,7 +74,7 @@ esbuild(
"//ts/lib", "//ts/lib",
"//ts/lib:backend_proto", "//ts/lib:backend_proto",
":index", ":index",
"//ts/sass:core_css", ":base_css",
] + svelte_names, ] + svelte_names,
) )

View File

@ -3,8 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
--> -->
<script lang="typescript"> <script lang="typescript">
import "../sass/core.css";
import type { SvelteComponent } from "svelte/internal"; import type { SvelteComponent } from "svelte/internal";
import { writable } from "svelte/store"; import { writable } from "svelte/store";

View File

@ -0,0 +1,6 @@
@use 'ts/sass/base';
@use 'ts/sass/scrollbar';
.night-mode {
@include scrollbar.night-mode;
}

View File

@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" id="viewport" content="width=device-width" /> <meta name="viewport" id="viewport" content="width=device-width" />
<link href="graphs-base.css" rel="stylesheet" />
<link href="graphs.css" rel="stylesheet" /> <link href="graphs.css" rel="stylesheet" />
<script src="../js/vendor/protobuf.min.js"></script> <script src="../js/vendor/protobuf.min.js"></script>
<script src="graphs.js"></script> <script src="graphs.js"></script>

View File

@ -7,8 +7,8 @@ $font-weight-base: 500;
$link-hover-color: var(--link); $link-hover-color: var(--link);
$link-hover-decoration: none; $link-hover-decoration: none;
@import 'ts/node_modules/bootstrap/scss/bootstrap-reboot'; @import "ts/node_modules/bootstrap/scss/bootstrap-reboot";
@import 'ts/node_modules/bootstrap/scss/bootstrap-utilities'; @import "ts/node_modules/bootstrap/scss/bootstrap-utilities";
body { body {
overscroll-behavior: none; overscroll-behavior: none;