improve small elements rendering, bump to 0.4.2
This commit is contained in:
parent
7d8ab87eee
commit
cb0b071a38
3 changed files with 22 additions and 24 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "PLWL",
|
"name": "PLWL",
|
||||||
"productName": "PLWL",
|
"productName": "PLWL",
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"description": "Portable Linux Wine Launcher",
|
"description": "Portable Linux Wine Launcher",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,17 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
// The CSS scales the root font size with the window width (max(15px, 100vw/90)),
|
||||||
|
// which is fractional at almost every width - every rem value in the UI then
|
||||||
|
// lands on a fractional pixel and text/border rounding drifts a pixel up or
|
||||||
|
// down while resizing (badges were the most visible case). Snap it to whole
|
||||||
|
// pixels so the whole layout steps in 1px root increments instead.
|
||||||
|
function snapRootFontSize() {
|
||||||
|
const px = Math.max(15, Math.round(window.innerWidth / 90))
|
||||||
|
document.documentElement.style.fontSize = px + 'px'
|
||||||
|
}
|
||||||
|
snapRootFontSize()
|
||||||
|
window.addEventListener('resize', snapRootFontSize, { passive: true })
|
||||||
|
|
||||||
const qs = s => document.querySelector(s)
|
const qs = s => document.querySelector(s)
|
||||||
const qsa = s => [...document.querySelectorAll(s)]
|
const qsa = s => [...document.querySelectorAll(s)]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@
|
||||||
src: url('Nunito-Black.ttf') format('truetype');
|
src: url('Nunito-Black.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
transform: translateZ(0);
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--main-bg-color: rgb(20, 20, 20);
|
--main-bg-color: rgb(20, 20, 20);
|
||||||
--panel-color: rgb(26, 26, 26);
|
--panel-color: rgb(26, 26, 26);
|
||||||
|
|
@ -16,7 +20,7 @@
|
||||||
--button-margin: 0.4rem;
|
--button-margin: 0.4rem;
|
||||||
--button-height: 2.4rem;
|
--button-height: 2.4rem;
|
||||||
--icon-button-size: 3.4rem;
|
--icon-button-size: 3.4rem;
|
||||||
--border-width: 0.09rem;
|
--border-width: 0.08rem;
|
||||||
--big-default: rgb(207, 207, 207);
|
--big-default: rgb(207, 207, 207);
|
||||||
--big-red: hsl(0, 68%, 52%);
|
--big-red: hsl(0, 68%, 52%);
|
||||||
--big-green: hsl(120, 60%, 55%);
|
--big-green: hsl(120, 60%, 55%);
|
||||||
|
|
@ -103,10 +107,6 @@ sidebarelement.active .icon-button { background: rgba(255, 255, 255, 0.05); }
|
||||||
border: var(--border-width) solid transparent;
|
border: var(--border-width) solid transparent;
|
||||||
border-radius: 0.8rem;
|
border-radius: 0.8rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
backface-visibility: hidden;
|
|
||||||
transform: translateZ(0);
|
|
||||||
will-change: transform;
|
|
||||||
transform-origin: center center;
|
|
||||||
}
|
}
|
||||||
.icon-button:hover { background: rgba(255, 255, 255, 0.05); }
|
.icon-button:hover { background: rgba(255, 255, 255, 0.05); }
|
||||||
.icon-button:active { background: rgba(255, 255, 255, 0.1); transform: var(--press-scale); }
|
.icon-button:active { background: rgba(255, 255, 255, 0.1); transform: var(--press-scale); }
|
||||||
|
|
@ -211,10 +211,6 @@ content {
|
||||||
/* only Regular and Black faces are bundled, so >=600 resolves to the same
|
/* only Regular and Black faces are bundled, so >=600 resolves to the same
|
||||||
bold rendering on every button; primary just adds the filled style */
|
bold rendering on every button; primary just adds the filled style */
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
backface-visibility: hidden;
|
|
||||||
transform: translateZ(0);
|
|
||||||
will-change: transform;
|
|
||||||
transform-origin: center center;
|
|
||||||
}
|
}
|
||||||
.button:hover { background-color: rgba(255, 255, 255, 0.09); }
|
.button:hover { background-color: rgba(255, 255, 255, 0.09); }
|
||||||
.button:active { background-color: rgba(255, 255, 255, 0.1); transform: var(--press-scale); }
|
.button:active { background-color: rgba(255, 255, 255, 0.1); transform: var(--press-scale); }
|
||||||
|
|
@ -260,10 +256,6 @@ input, textarea {
|
||||||
min-height: var(--button-height);
|
min-height: var(--button-height);
|
||||||
user-select: text !important;
|
user-select: text !important;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
backface-visibility: hidden;
|
|
||||||
transform: translateZ(0);
|
|
||||||
will-change: transform;
|
|
||||||
transform-origin: center center;
|
|
||||||
}
|
}
|
||||||
input:hover, textarea:hover { background-color: rgba(255, 255, 255, 0.09); }
|
input:hover, textarea:hover { background-color: rgba(255, 255, 255, 0.09); }
|
||||||
input:active, textarea:active { background-color: rgba(255, 255, 255, 0.1); }
|
input:active, textarea:active { background-color: rgba(255, 255, 255, 0.1); }
|
||||||
|
|
@ -298,8 +290,6 @@ input[type='checkbox'] {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
backface-visibility: hidden;
|
|
||||||
transform: translateZ(0);
|
|
||||||
transition: all 0.15s ease;
|
transition: all 0.15s ease;
|
||||||
}
|
}
|
||||||
input[type='checkbox']:hover { background-color: rgba(255, 255, 255, 0.09); }
|
input[type='checkbox']:hover { background-color: rgba(255, 255, 255, 0.09); }
|
||||||
|
|
@ -336,10 +326,6 @@ select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
backface-visibility: hidden;
|
|
||||||
transform: translateZ(0);
|
|
||||||
will-change: transform;
|
|
||||||
transform-origin: center center;
|
|
||||||
}
|
}
|
||||||
.custom-select:hover { background-color: rgba(255, 255, 255, 0.09); }
|
.custom-select:hover { background-color: rgba(255, 255, 255, 0.09); }
|
||||||
.custom-select:active { background-color: rgba(255, 255, 255, 0.1); transform: var(--press-scale); }
|
.custom-select:active { background-color: rgba(255, 255, 255, 0.1); transform: var(--press-scale); }
|
||||||
|
|
@ -558,11 +544,11 @@ select {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
.badge {
|
.badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
/* Nunito keeps a lot of air above the caps, so a line box centred by its
|
line-height: 1.2;
|
||||||
font metrics reads as "text sits high" (clearest on "Portable"); bias the
|
padding: 0.24em 0.7em 0.24em;
|
||||||
padding downwards, keeping the same overall height, to centre the label */
|
|
||||||
padding: 0.25em 0.7em 0.03em;
|
|
||||||
border-radius: 0.6rem;
|
border-radius: 0.6rem;
|
||||||
border: var(--border-width) solid var(--light-border-color);
|
border: var(--border-width) solid var(--light-border-color);
|
||||||
color: var(--darker-text-color);
|
color: var(--darker-text-color);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue