mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Fix selected tags not being highlighted (#2104)
* Give selected AutocompleteItem primary button style * Fix formatting
This commit is contained in:
parent
62266aece4
commit
d7b982ec9a
1 changed files with 10 additions and 8 deletions
|
@ -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 { pageTheme } from "../sveltelib/theme";
|
|
||||||
|
|
||||||
export let selected = false;
|
export let selected = false;
|
||||||
export let active = false;
|
export let active = false;
|
||||||
|
|
||||||
|
@ -23,9 +21,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<button
|
<button
|
||||||
bind:this={buttonRef}
|
bind:this={buttonRef}
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
class="autocomplete-item btn"
|
class="autocomplete-item"
|
||||||
class:btn-day={!$pageTheme.isDark}
|
|
||||||
class:btn-night={$pageTheme.isDark}
|
|
||||||
class:selected
|
class:selected
|
||||||
class:active
|
class:active
|
||||||
on:mousedown|preventDefault
|
on:mousedown|preventDefault
|
||||||
|
@ -41,14 +37,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
@use "sass/button-mixins" as button;
|
@use "sass/button-mixins" as button;
|
||||||
|
|
||||||
.autocomplete-item {
|
.autocomplete-item {
|
||||||
|
@include button.base($with-disabled: false, $active-class: active);
|
||||||
padding: 1px 7px 2px;
|
padding: 1px 7px 2px;
|
||||||
|
|
||||||
text-align: start;
|
text-align: start;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
|
||||||
button {
|
&.selected {
|
||||||
@include button.base($with-disabled: false, $active-class: active);
|
@include button.base(
|
||||||
|
$primary: true,
|
||||||
|
$with-disabled: false,
|
||||||
|
$active-class: active
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue