mirror of
https://github.com/ankitects/anki.git
synced 2025-11-17 01:57:12 -05:00
* Layout toolbar using CSS grid, introducing left and right trays The trays provide a space for add-ons to introduce their own widgets to the toolbar without interfering with each other. * Align tray items to the top * Move absolutely positioned add-on items to right toolbar tray Workaround that fixes breakages in add-ons like AMBOSS, Study Timer, and potentially others that currently still inject absolutely positioned elements into the toolbar using `top_toolbar_did_init_links`. * Account for add-ons that add manual padding (e.g. Study Timer) * Add docstrings and slightly refactor * Tweak item alignment * Introduce hooks for extending left and right toolbar trays * Assign CSS classes to all tray items * Add disclaimer on transitional nature of new hooks
130 lines
2.5 KiB
SCSS
130 lines
2.5 KiB
SCSS
/* Copyright: Ankitects Pty Ltd and contributors
|
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
|
|
|
@use "sass/root-vars";
|
|
@use "sass/vars" as *;
|
|
@use "sass/elevation" as *;
|
|
@use "sass/button-mixins" as button;
|
|
|
|
.header {
|
|
height: 41px;
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
align-items: start;
|
|
align-content: space-between;
|
|
}
|
|
|
|
.left-tray {
|
|
justify-self: start;
|
|
}
|
|
|
|
.right-tray {
|
|
justify-self: end;
|
|
}
|
|
|
|
.left-tray,
|
|
.right-tray {
|
|
align-self: start;
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: start;
|
|
}
|
|
|
|
.toolbar {
|
|
height: 31px;
|
|
justify-self: center;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
border-bottom-left-radius: prop(border-radius-large);
|
|
border-bottom-right-radius: prop(border-radius-large);
|
|
@include elevation(1, $opacity-boost: -0.1);
|
|
|
|
// elevated state (deck browser, overview)
|
|
body:not(.flat) & {
|
|
background: var(--canvas-elevated);
|
|
@include elevation(1);
|
|
&:hover {
|
|
@include elevation(2);
|
|
}
|
|
}
|
|
// glass effect
|
|
background: var(--canvas-glass);backdrop-filter: unset;
|
|
backdrop-filter: blur(var(--blur));
|
|
|
|
transition: all var(--transition) ease-in-out;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
-webkit-user-select: none;
|
|
overflow: hidden;
|
|
|
|
&.collapsed {
|
|
transform: translateY(-100vh);
|
|
}
|
|
transition: transform var(--transition) ease-in-out;
|
|
}
|
|
|
|
* {
|
|
-webkit-user-drag: none;
|
|
}
|
|
|
|
.hitem {
|
|
font-weight: bold;
|
|
padding: 6px 12px 8px;
|
|
text-decoration: none;
|
|
color: color(fg);
|
|
display: inline-block;
|
|
|
|
body:not(.flat) &,
|
|
&:hover {
|
|
@include button.base($border: false);
|
|
background: var(--canvas-elevated);
|
|
}
|
|
&:first-child {
|
|
padding-left: 18px;
|
|
}
|
|
&:last-child {
|
|
padding-right: 18px;
|
|
}
|
|
}
|
|
|
|
.hitem:focus {
|
|
outline: 0;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% {
|
|
-webkit-transform: rotate(0deg);
|
|
}
|
|
100% {
|
|
-webkit-transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
.spin {
|
|
width: 16px !important;
|
|
animation: spin;
|
|
animation-duration: 2s;
|
|
animation-iteration-count: infinite;
|
|
display: inline-block;
|
|
visibility: visible !important;
|
|
animation-timing-function: linear;
|
|
transition: all var(--transition) ease-in;
|
|
}
|
|
|
|
#sync-spinner {
|
|
height: 16px;
|
|
margin-bottom: -3px;
|
|
visibility: hidden;
|
|
width: 0;
|
|
}
|
|
|
|
.normal-sync {
|
|
color: color(state-new);
|
|
}
|
|
|
|
.full-sync {
|
|
color: color(state-learn);
|
|
}
|