Skip to content

Commit

Permalink
style: hardcode dimensions rather than scaling with rem
Browse files Browse the repository at this point in the history
We are not under control of rem. (E.g. lektor-website currently sets
rem to 10px which makes the toolbar tiny.)
  • Loading branch information
dairiki committed Nov 6, 2023
1 parent e7dd561 commit 8174297
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/tooldrawer/components/css/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default css`
color: var(--lektor-button-color);
background-color: var(--lektor-button-bg);
font-size: 1.7rem;
aspect-ratio: 1/1;
cursor: pointer;
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/tooldrawer/components/drag-handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ export class DragHandle extends LitElement {
static override styles = css`
#handle {
cursor: grab;
width: 100%;
width: 17px;
height: 100%;
display: flex;
}
#icon {
margin: 3px;
flex-grow: 1;
margin: 0.15em;
background: radial-gradient(currentcolor 35%, transparent 45%) left /
0.3em 0.3em repeat space;
background: radial-gradient(currentcolor 35%, transparent 45%) left / 6px
6px repeat space;
}
#cover {
Expand Down
17 changes: 8 additions & 9 deletions frontend/tooldrawer/components/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ export class LektorDrawer extends WidgetMixin(LitElement) {
right: 0;
z-index: 1000;
font-size: 1.2rem;
min-height: 2rem;
min-height: 32px; /* 2rem */
color: var(--lektor-drawer-color);
background-color: var(--lektor-drawer-bg);
border: 1px solid var(--lektor-drawer-border-color);
Expand All @@ -215,7 +214,7 @@ export class LektorDrawer extends WidgetMixin(LitElement) {
display: flex;
/* move drawer off-screen to the right just enough to leave the toggle control visible */
transform: translateX(calc(100% - 0.8em - 1px));
transform: translateX(calc(100% - 17px));
transition: transform 0.5s ease-out;
}
#drawer.open,
Expand All @@ -234,8 +233,8 @@ export class LektorDrawer extends WidgetMixin(LitElement) {
align-items: center;
}
lektor-icon {
width: 0.6em;
margin: 0.1em;
width: 12px;
margin: 2px;
}
#drawer:not(.open) #icon-open,
#drawer:where(.open, .closing, :not(:hover, :active, :focus-within))
Expand All @@ -245,15 +244,15 @@ export class LektorDrawer extends WidgetMixin(LitElement) {
display: none;
}
::slotted(*) {
font-size: 28px;
}
slot {
margin: 3px;
display: flex;
align-items: center;
gap: 3px;
}
lektor-drag-handle {
width: 0.9em;
}
`;
}

0 comments on commit 8174297

Please sign in to comment.