mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Move ticks.scss directly into Graph.svelte
This commit is contained in:
parent
7d8f19e6e4
commit
af307a6c4a
3 changed files with 33 additions and 57 deletions
|
@ -3,12 +3,6 @@ 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 = "ticks",
|
|
||||||
src = "ticks.scss",
|
|
||||||
)
|
|
||||||
|
|
||||||
svelte_files = glob(["*.svelte"])
|
svelte_files = glob(["*.svelte"])
|
||||||
|
|
||||||
|
@ -69,7 +63,6 @@ esbuild(
|
||||||
"//ts/lib:backend_proto",
|
"//ts/lib:backend_proto",
|
||||||
"//ts/lib:fluent_proto",
|
"//ts/lib:fluent_proto",
|
||||||
":index",
|
":index",
|
||||||
":ticks",
|
|
||||||
"//ts/sass:core_css",
|
"//ts/sass:core_css",
|
||||||
] + svelte_names,
|
] + svelte_names,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
<script context="module">
|
|
||||||
// custom tick styling
|
|
||||||
import "./ticks.css";
|
|
||||||
|
|
||||||
// see graph-style.ts for constants referencing global styles
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
export let title: string;
|
export let title: string;
|
||||||
export let subtitle: string | null = null;
|
export let subtitle: string | null = null;
|
||||||
|
@ -16,6 +9,39 @@
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
max-width: 60em;
|
max-width: 60em;
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
|
|
||||||
|
:global(.graph-element-clickable) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Customizing the standard x and y tick markers and text on the graphs.
|
||||||
|
* The `tick` class is automatically added by d3. */
|
||||||
|
:global(.tick) {
|
||||||
|
:global(line) {
|
||||||
|
opacity: 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(text) {
|
||||||
|
opacity: 0.5;
|
||||||
|
font-size: 10px;
|
||||||
|
|
||||||
|
@media only screen and (max-width: 800px) {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.tick-odd) {
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
/* on small screens, hide every second row on graphs that have
|
||||||
|
* marked the ticks as odd */
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
|
@ -28,9 +54,6 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
.graph :global(.graph-element-clickable) {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="graph">
|
<div class="graph">
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
|
||||||
|
|
||||||
// Customizing the standard x and y tick markers and text on the graphs. The `tick`
|
|
||||||
// class is automatically added by d3. We apply our custom ticks only to ticks
|
|
||||||
// that are nested under a Graph component.
|
|
||||||
|
|
||||||
.graph {
|
|
||||||
.tick {
|
|
||||||
line {
|
|
||||||
opacity: 0.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
opacity: 0.5;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
|
||||||
.tick {
|
|
||||||
text {
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 600px) {
|
|
||||||
.tick {
|
|
||||||
text {
|
|
||||||
font-size: 16px;
|
|
||||||
// on small screens, hide every second row on graphs that have
|
|
||||||
// marked the ticks as odd
|
|
||||||
&.tick-odd {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue