1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-18 17:02:27 +02:00

Third pass to re-design the dashboard

Related commits:
- 453f5450b6
- a45a21f337

This commit fixes parts of the re-design not
rendering as intended as per <https://github.com/brampitoyo>'s
feedback screenshots.

The dashboard tab buttons have been converted to
`span` tags (from `a` tags), thus eliminating
the unwanted side effect of the text being
rendered as unvisited links (blueish).

The font size intended for touch screens was not
taking effect due to bad cut & paste.

Other minor adjustments to improve consistency
in spacing.
This commit is contained in:
Raymond Hill 2020-04-09 09:20:29 -04:00
parent 923e9fd8f6
commit a8e3118fea
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
5 changed files with 39 additions and 41 deletions

View File

@ -4,10 +4,14 @@
} }
body { body {
border: 0; border: 0;
font: 14px/21px sans-serif; font: 14px/1.5 sans-serif;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
input[type="checkbox"] {
margin-inline-end: 0.5em;
-webkit-margin-end: 0.5em;
}
.root { .root {
background-color: white; background-color: white;
overflow: auto; overflow: auto;
@ -18,14 +22,17 @@ body {
display: flex; display: flex;
margin: 0.5em 0; margin: 0.5em 0;
} }
.entry > * {
margin-left: 0;
margin-right: 0;
margin-inline-end: 0.5em;
-webkit-margin-end: 0.5em;
}
#actions { #actions {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 10; z-index: 10;
} }
#options li {
margin-bottom: 0.5em;
}
#listsOfBlockedHostsPrompt { #listsOfBlockedHostsPrompt {
cursor: pointer; cursor: pointer;
} }
@ -33,11 +40,6 @@ body {
margin: 0.5em 0 0 0; margin: 0.5em 0 0 0;
padding: 0; padding: 0;
} }
#lists > li {
margin: 0.5em 0 0 0;
padding: 0;
list-style-type: none;
}
#listsOfBlockedHostsPrompt::before, #listsOfBlockedHostsPrompt::before,
.groupEntry:not([data-groupkey="user"]) .geDetails::before { .groupEntry:not([data-groupkey="user"]) .geDetails::before {
color: #888; color: #888;
@ -64,10 +66,6 @@ body.hideUnused #listsOfBlockedHostsPrompt::before,
font-size: 90%; font-size: 90%;
pointer-events: none; pointer-events: none;
} }
.groupEntry > ul {
margin: 0.25em 0 0 0;
padding-left: 1em;
}
.listEntries { .listEntries {
margin-inline-start: 0.7em; margin-inline-start: 0.7em;
-webkit-margin-start: 0.7em; -webkit-margin-start: 0.7em;
@ -80,11 +78,15 @@ body.hideUnused #listsOfBlockedHostsPrompt::before,
display: none; display: none;
} }
.listEntry > * { .listEntry > * {
margin-right: 0.5em; margin-left: 0;
margin-right: 0;
margin-inline-end: 0.5em;
-webkit-margin-end: 0.5em;
unicode-bidi: embed; unicode-bidi: embed;
} }
.listEntry input[type="checkbox"] { .listEntry > label {
margin-right: 0.5em; align-items: center;
display: inline-flex;
} }
.listEntry.toRemove input[type="checkbox"] { .listEntry.toRemove input[type="checkbox"] {
visibility: hidden; visibility: hidden;
@ -179,6 +181,7 @@ body.updating .listEntry.checked.obsolete .updating {
display: block; display: block;
font-size: smaller; font-size: smaller;
height: 6em; height: 6em;
margin: 0;
resize: vertical; resize: vertical;
visibility: hidden; visibility: hidden;
white-space: pre; white-space: pre;
@ -189,7 +192,7 @@ body.updating .listEntry.checked.obsolete .updating {
} }
@media (pointer: coarse) { @media (pointer: coarse) {
#dashboard-nav { body {
font: 16px/24px sans-serif; font: 16px/1.5 sans-serif;
} }
} }

View File

@ -1,6 +1,6 @@
html, body { html, body {
border: 0; border: 0;
font: 14px/21px sans-serif; font: 14px/1.5 sans-serif;
height: 100%; height: 100%;
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
@ -21,13 +21,13 @@ html, body {
width: 100%; width: 100%;
z-index: 10; z-index: 10;
} }
#dashboard-nav > span { #dashboard-nav > span.logo {
align-items: center; align-items: center;
display: inline-flex; display: inline-flex;
padding: 0 0.5em; padding: 0 0.5em;
width: 1.25em; width: 1.25em;
} }
#dashboard-nav > span > img { #dashboard-nav > span.logo > img {
width: 100%; width: 100%;
} }
.tabButton { .tabButton {
@ -41,10 +41,6 @@ html, body {
.tabButton:focus { .tabButton:focus {
outline: 0; outline: 0;
} }
.tabButton:active,
.tabButton:visited {
color: #20123a;
}
.tabButton.selected { .tabButton.selected {
border-bottom: 3px solid #592acb; border-bottom: 3px solid #592acb;
color: #592acb; color: #592acb;
@ -77,14 +73,14 @@ iframe {
width: 100vw; width: 100vw;
} }
body:not(.canUpdateShortcuts) .tabButton[href="#shortcuts.html"] { body:not(.canUpdateShortcuts) .tabButton[data-pane="shortcuts.html"] {
display: none; display: none;
} }
@media (pointer: coarse) { @media (pointer: coarse) {
#dashboard-nav { #dashboard-nav {
flex-wrap: nowrap; flex-wrap: nowrap;
font: 16px/24px sans-serif; font: 16px/1.5 sans-serif;
overflow-x: auto; overflow-x: auto;
} }
} }

View File

@ -1,6 +1,6 @@
body { body {
border: 0; border: 0;
font: 14px/21px sans-serif; font: 14px/1.5 sans-serif;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
@ -42,7 +42,7 @@ body.advancedUser #advanced-user-enabled ~ a.fa {
} }
@media (pointer: coarse) { @media (pointer: coarse) {
#dashboard-nav { body {
font: 16px/24px sans-serif; font: 16px/1.5 sans-serif;
} }
} }

View File

@ -11,14 +11,14 @@
<body> <body>
<div id="dashboard-nav"> <div id="dashboard-nav">
<span class="hverbose" ><img data-i18n-title="extName" src="img/ublock.svg"></span><!-- <span class="logo" ><img data-i18n-title="extName" src="img/ublock.svg"></span><!--
--><a class="tabButton" href="#settings.html" data-i18n="settingsPageName"></a><!-- --><span class="tabButton" data-pane="settings.html" data-i18n="settingsPageName"></span><!--
--><a class="tabButton" href="#3p-filters.html" data-i18n="3pPageName"></a><!-- --><span class="tabButton" data-pane="3p-filters.html" data-i18n="3pPageName"></span><!--
--><a class="tabButton" href="#1p-filters.html" data-i18n="1pPageName"></a><!-- --><span class="tabButton" data-pane="1p-filters.html" data-i18n="1pPageName"></span><!--
--><a class="tabButton" href="#dyna-rules.html" data-i18n="rulesPageName"></a><!-- --><span class="tabButton" data-pane="dyna-rules.html" data-i18n="rulesPageName"></span><!--
--><a class="tabButton" href="#whitelist.html" data-i18n="whitelistPageName"></a><!-- --><span class="tabButton" data-pane="whitelist.html" data-i18n="whitelistPageName"></span><!--
--><a class="tabButton" href="#shortcuts.html" data-i18n="shortcutsPageName"></a><!-- --><span class="tabButton" data-pane="shortcuts.html" data-i18n="shortcutsPageName"></span><!--
--><a class="tabButton" href="#about.html" data-i18n="aboutPageName"></a> --><span class="tabButton" data-pane="about.html" data-i18n="aboutPageName"></span>
</div> </div>
<div id="unsavedWarning"> <div id="unsavedWarning">
<div> <div>

View File

@ -84,7 +84,7 @@ const discardUnsavedData = function(synchronous = false) {
}; };
const loadDashboardPanel = function(pane, first) { const loadDashboardPanel = function(pane, first) {
const tabButton = uDom.nodeFromSelector(`[href="#${pane}"]`); const tabButton = uDom.nodeFromSelector(`[data-pane="${pane}"]`);
if ( tabButton === null || tabButton.classList.contains('selected') ) { if ( tabButton === null || tabButton.classList.contains('selected') ) {
return; return;
} }
@ -111,8 +111,7 @@ const loadDashboardPanel = function(pane, first) {
}; };
const onTabClickHandler = function(ev) { const onTabClickHandler = function(ev) {
loadDashboardPanel(ev.target.hash.slice(1)); loadDashboardPanel(ev.target.getAttribute('data-pane'));
ev.preventDefault();
}; };
// https://github.com/uBlockOrigin/uBlock-issues/issues/106 // https://github.com/uBlockOrigin/uBlock-issues/issues/106