Options tweaks (#1077)

* Options tweaks

* account for last-child change
This commit is contained in:
narcolepticinsomniac 2020-10-23 09:51:46 -04:00 committed by GitHub
parent 595b037ab1
commit 8598b71a73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 273 additions and 243 deletions

View File

@ -41,13 +41,15 @@
<div id="options"> <div id="options">
<div class="options-wrapper">
<div class="block"> <div class="block">
<h1 i18n-text="cm_theme"></h1> <h1 i18n-text="cm_theme"></h1>
<div class="items"> <div class="items">
<label> <div class="label">
<a i18n-text="optionsStylusThemes" target="_blank" <a i18n-text="optionsStylusThemes" target="_blank"
href="https://33kk.github.io/uso-archive/?category=chrome-extension&search=Stylus"></a> href="https://33kk.github.io/uso-archive/?category=chrome-extension&search=Stylus"></a>
</label> </div>
</div> </div>
</div> </div>
@ -280,6 +282,8 @@
</div> </div>
</div> </div>
</div>
<div class="block" id="actions"> <div class="block" id="actions">
<button data-cmd="reset" i18n-text="optionsResetButton" i18n-title="optionsReset"></button> <button data-cmd="reset" i18n-text="optionsResetButton" i18n-title="optionsReset"></button>
<button data-cmd="open-manage" i18n-text="styleCancelEditLabel"></button> <button data-cmd="open-manage" i18n-text="styleCancelEditLabel"></button>

View File

@ -27,9 +27,38 @@ body.scaleout {
#options { #options {
background: #fff; background: #fff;
display: flex;
flex-direction: column;
overflow: hidden;
}
.options-wrapper {
overflow-y: auto; overflow-y: auto;
} }
a {
color: #000;
transition: color .5s;
}
a:hover {
color: #666;
}
.svg-icon {
fill: #666;
transition: fill .5s;
}
a:hover .svg-icon,
.svg-icon:hover {
fill: #000;
}
.svg-inline-wrapper .svg-icon {
pointer-events: none;
}
#options-close-icon .svg-icon { #options-close-icon .svg-icon {
fill: #666; fill: #666;
transition: fill .5s; transition: fill .5s;
@ -91,13 +120,9 @@ body.scaleout {
position: relative; position: relative;
} }
.block:nth-last-child(2) { .options-wrapper .block:last-child {
margin-bottom: 0; margin-bottom: 0;
}
.block:last-child {
border-bottom: none; border-bottom: none;
padding-bottom: 0;
} }
.collapsed, .collapsible h1 { .collapsed, .collapsible h1 {
@ -139,15 +164,16 @@ label,
label > :first-child { label > :first-child {
margin-right: 8px; margin-right: 8px;
flex-grow: 1; flex-grow: 1;
transition: text-shadow: .1s;
} }
label:not([disabled]) > :first-child { label:not([disabled]),
cursor: default; label:not([disabled]) :not([type="number"]) {
cursor: pointer;
} }
label:not([disabled]):hover > :first-child { label:not([disabled]):hover > :first-child {
text-shadow: 0 0 0.01px rgba(0, 0, 0, .25); text-shadow: 0 0 0.01px rgba(0, 0, 0, .25);
cursor: pointer;
} }
input[type=number], input[type=number],
@ -201,6 +227,8 @@ input[type="color"] {
white-space: nowrap; white-space: nowrap;
background-color: rgba(0, 0, 0, .05); background-color: rgba(0, 0, 0, .05);
margin: 0; margin: 0;
border-top: 1px solid #999;
border-bottom: none;
} }
#actions button { #actions button {

View File

@ -245,6 +245,7 @@ function setupRadioButtons() {
function splitLongTooltips() { function splitLongTooltips() {
for (const el of $$('[title]')) { for (const el of $$('[title]')) {
el.dataset.title = el.title;
if (el.title.length < 50) { if (el.title.length < 50) {
continue; continue;
} }
@ -253,10 +254,7 @@ function splitLongTooltips() {
.map(s => s.replace(/([^.][.。?!]|.{50,60},)\s+/g, '$1\n')) .map(s => s.replace(/([^.][.。?!]|.{50,60},)\s+/g, '$1\n'))
.map(s => s.replace(/(.{50,80}(?=.{40,}))\s+/g, '$1\n')) .map(s => s.replace(/(.{50,80}(?=.{40,}))\s+/g, '$1\n'))
.join('\n'); .join('\n');
if (newTitle !== el.title) { if (newTitle !== el.title) el.title = newTitle;
el.dataset.title = el.title;
el.title = newTitle;
}
} }
} }