anki/sass/BUILD.bazel
Matthias Metelka f72570c604
Make tags editor resizable using Henrik's components (#2046)
* Make tags editor resizable using Henrik's components

All credit for the components goes to Henrik. I just tweaked the design a bit and implemented them in NoteEditor.

Co-Authored-By: Henrik Giesel <hengiesel@gmail.com>

* Remove PaneContent padding

Co-Authored-By: Henrik Giesel <hengiesel@gmail.com>

* Add responsive box-shadows on scroll/resize

only shown when content overflows in the respective direction.

* Remove comment

* Fix overflow calculations and shadow mix-up

This happened when I switched from using scrolledToX to overflowX booleans.

* Simplify overflow calculations

* Make drag handles 0 height/width

The remaining height requirement comes from a margin set on NoteEditor.

* Run eslint on components

* Split editor into three panes: Toolbar, Fields, Tags

* Remove upper split for now

to unblock 2.1.55 beta

* Move panes.scss to sass folder

* Use single type for resizable panes

* Implement collapsed state toggled with click on resizer

* Add button to uncollapse tags pane and focus input

* Add indicator for # of tags

* Use dbclick to prevent interference with resize state

* Add utility functions for expand/collapse

* Meddle around with types and formatting

* Fix collapsed state being forgotten on second browser open (dae)

* Fix typecheck (dae)

Our tooling generates .d.ts files from the Svelte files, but it doesn't
expect variables to be exported. By changing them into functions, they
get included in .bazel/bin/ts/components/Pane.svelte.d.ts

* Remove an unnecessary bridgeCommand (dae)

* Fix the bottom of tags getting cut off (dae)

Not sure why offsetHeight is inaccurate in this case.

* Add missing header (dae)

Co-authored-by: Henrik Giesel <hengiesel@gmail.com>
2022-09-28 14:02:32 +10:00

110 lines
2.0 KiB
Python

load("@io_bazel_rules_sass//:defs.bzl", "sass_library")
load("//ts:compile_sass.bzl", "compile_sass")
sass_library(
name = "base_lib",
srcs = [
"base.scss",
"bootstrap-dark.scss",
],
visibility = ["//visibility:public"],
deps = [
"vars_lib",
"//sass/bootstrap",
],
)
sass_library(
name = "vars_lib",
srcs = [
"_colors.scss",
"_functions.scss",
"_vars.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "buttons_lib",
srcs = [
"buttons.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "card_counts_lib",
srcs = [
"card-counts.scss",
],
visibility = ["//visibility:public"],
)
# minimal definitions used by AnkiMobile's editor - should be safe to remove
# once AnkiMobile switches to the new editor code in the future
sass_library(
name = "core_lib",
srcs = [
"_vars.scss",
"core.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "scrollbar_lib",
srcs = [
"scrollbar.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "panes_lib",
srcs = [
"panes.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "breakpoints_lib",
srcs = [
"breakpoints.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "button_mixins_lib",
srcs = [
"_button-mixins.scss",
],
visibility = ["//visibility:public"],
deps = [
"vars_lib",
],
)
sass_library(
name = "night_mode_lib",
srcs = [
"night-mode.scss",
],
visibility = ["//visibility:public"],
)
sass_library(
name = "elevation_lib",
srcs = [
"elevation.scss",
],
visibility = ["//visibility:public"],
)
compile_sass(
srcs = ["_vars.scss"],
group = "vars_css",
visibility = ["//visibility:public"],
)