fix(frontend): opened policy rule stays in view while its card grows, chevrons hold one column, switch and field sizes match the rest
This commit is contained in:
1 parent
dfc726976b
commit
0362777a51
2 files changed
+37
-9
No files matched your search
@@ -509,10 +509,10 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
width: 2.125rem;
|
width: 2.25rem;
|
||||||
height: 1.25rem;
|
height: 1.375rem;
|
||||||
padding: 0.125rem;
|
padding: 0.125rem;
|
||||||
border-radius: 0.625rem;
|
border-radius: 0.6875rem;
|
||||||
|
|
||||||
background-color: var(--color-borders-input);
|
background-color: var(--color-borders-input);
|
||||||
|
|
||||||
@@ -524,8 +524,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.knob {
|
.knob {
|
||||||
width: 1rem;
|
width: 1.125rem;
|
||||||
height: 1rem;
|
height: 1.125rem;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|
||||||
background-color: var(--color-white);
|
background-color: var(--color-white);
|
||||||
|
|||||||
@@ -107,9 +107,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reveal(node: HTMLElement) {
|
function reveal(node: HTMLElement) {
|
||||||
requestAnimationFrame(() => {
|
const observer = new ResizeObserver(() => {
|
||||||
node.parentElement?.scrollIntoView({ block: "nearest" });
|
node.parentElement?.scrollIntoView({ block: "nearest" });
|
||||||
});
|
});
|
||||||
|
observer.observe(node);
|
||||||
|
return () => observer.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
function draftBefore(rule: PolicyRule): boolean {
|
function draftBefore(rule: PolicyRule): boolean {
|
||||||
@@ -237,13 +239,21 @@
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
<Icon name={open ? "up" : "down"} size="1.125rem" />
|
|
||||||
</button>
|
</button>
|
||||||
{#if extra}
|
{#if extra}
|
||||||
<Button onclick={() => drop(rule)} smaller variant="text">
|
<Button onclick={() => drop(rule)} smaller variant="text">
|
||||||
Убрать
|
Убрать
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
<button
|
||||||
|
aria-hidden="true"
|
||||||
|
class="chevron"
|
||||||
|
onclick={() => toggle(rule)}
|
||||||
|
tabindex="-1"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<Icon name={open ? "up" : "down"} size="1.125rem" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{#if open}
|
{#if open}
|
||||||
<div class="editor" {@attach reveal}>
|
<div class="editor" {@attach reveal}>
|
||||||
@@ -474,7 +484,7 @@
|
|||||||
.line {
|
.line {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-right: 0.5rem;
|
padding-right: 0.375rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
@@ -516,6 +526,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chevron {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
width: 2rem;
|
||||||
|
height: 2.5rem;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
|
||||||
|
color: var(--color-text-secondary);
|
||||||
|
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
.glyph {
|
.glyph {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -619,7 +647,7 @@
|
|||||||
margin: 0.25rem 0.5rem 0.5rem;
|
margin: 0.25rem 0.5rem 0.5rem;
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
border: 1px solid var(--color-borders);
|
border: 1px solid var(--color-borders);
|
||||||
border-radius: var(--border-radius-default-small);
|
border-radius: var(--border-radius-default);
|
||||||
|
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: 0.9375rem;
|
font-size: 0.9375rem;
|
||||||
|
|||||||
Reference in new issue
Block a user