mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Update CSS for ColorPicker and forecolor button
This commit is contained in:
parent
9f740f307d
commit
02c8893fc9
2 changed files with 15 additions and 25 deletions
|
@ -1,50 +1,40 @@
|
|||
<script lang="typescript">
|
||||
import { getContext } from "svelte";
|
||||
import { nightModeKey } from "./contextKeys";
|
||||
|
||||
export let id: string;
|
||||
export let className = "";
|
||||
export let tooltip: string;
|
||||
|
||||
export let onChange: (event: Event) => void;
|
||||
|
||||
function extendClassName(className: string): string {
|
||||
return `btn ${className}`;
|
||||
}
|
||||
|
||||
const nightMode = getContext(nightModeKey);
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
button {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
|
||||
&:hover {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
&:active {
|
||||
box-shadow: inset 0 0 calc(var(--toolbar-size) / 2.5)
|
||||
calc(var(--toolbar-size) / 7.5) rgb(0 0 0 / 30%);
|
||||
border-color: #aaa;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input {
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
width: calc(var(--toolbar-size) - 6px);
|
||||
height: calc(var(--toolbar-size) - 6px);
|
||||
|
||||
cursor: pointer;
|
||||
width: calc(var(--toolbar-size) - 2px);
|
||||
height: calc(var(--toolbar-size) - 7px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<button
|
||||
tabindex="-1"
|
||||
{id}
|
||||
class={className}
|
||||
class={extendClassName(className)}
|
||||
class:btn-light={!nightMode}
|
||||
class:btn-secondary={nightMode}
|
||||
title={tooltip}
|
||||
on:mousedown|preventDefault>
|
||||
<span> <input type="color" on:change={onChange} /> </span>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
}
|
||||
|
||||
.forecolor {
|
||||
color: var(--foreground-color);
|
||||
color: var(--foreground-color) !important;
|
||||
}
|
||||
|
||||
.rainbow {
|
||||
|
|
Loading…
Reference in a new issue