uBlock/src/css/popup-fenix.css
Raymond Hill 5bee33253f
More work toward redesigning the UI
As per email feedback from Mozilla's
https://github.com/brampitoyo

This is yet another incremental step toward
redesigning the UI, much more is left to do.
The idea is to align uBO's UI to that of
Firefox Preview.

Additionally, code has been added to reset
the new popup panel to vertical layout should
the viewport be not wide enough to
accomodate the horizontal layout.

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/g4ufvi/
2020-04-21 16:33:08 -04:00

500 lines
12 KiB
CSS

/* External CSS values override */
.fa-icon {
padding: 0 0.1em;
}
.fa-icon.fa-icon-badged > .fa-icon-badge {
bottom: auto;
top: -20%;
}
/* Internal CSS values */
:root body,
:root.mobile body {
font-size: 14px;
line-height: 20px;
width: 100%;
}
a {
color: inherit;
text-decoration: none;
}
:focus {
outline: 0;
}
#panes {
align-items: stretch;
display: flex;
flex-direction: column;
padding: 0;
position: relative;
width: 100%;
}
hr {
border: 0;
border-top: 1px solid #e3e2e3;
margin: 0;
padding: 0;
}
.fa {
font-size: 120%;
}
#sticky {
background-color: var(--default-surface);
position: sticky;
top: 0;
z-index: 100;
}
#sticky > div {
align-items: stretch;
display: flex;
justify-content: space-between;
}
#switch {
display: flex;
flex-grow: 2;
justify-content: center;
margin: 0.5em 0;
}
#switch .fa-icon {
color: var(--fg-popup-power);
fill: var(--fg-popup-power);
cursor: pointer;
font-size: 700%;
margin: 0;
padding: 0;
}
#switch .fa-icon:hover {
filter: var(--fg-popup-power-hover);
}
body.off #switch .fa-icon {
color: var(--fg-0-20);
fill: var(--fg-0-20);
}
.rulesetTools {
background-color: transparent;
border: 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: space-evenly;
padding: 0.5em;
}
.rulesetTools [id] {
background-color: var(--bg-transient-notice);
border: 1px solid #ddc;
border-radius: 4px;
cursor: pointer;
fill: #888;
flex-grow: 1;
font-size: 2.2em;
padding: 0;
visibility: hidden;
}
.rulesetTools [id]:not(:first-of-type) {
margin-top: 0.2em;
}
body.needReload #refresh,
body.needSave #saveRules,
body.needSave #revertRules {
visibility: visible;
}
.itemRibbon {
display: grid;
gap: 0.8em 1em;
grid-template: auto / auto auto;
padding: 1em 1em;
}
.itemRibbon > [data-i18n] + span {
justify-self: end;
text-align: end;
white-space: nowrap;
}
.itemRibbon > .h-gutter {
display: inline-block;
height: 1em;
}
.toolRibbon {
align-items: start;
display: grid;
grid-template: auto / 25% 25% 25% 25%;
justify-items: center;
margin: 1em 0;
white-space: normal;
}
.toolRibbon .tool {
display: flex;
flex-direction: column;
font-size: 1.4em;
min-width: 32px;
}
.tool {
cursor: pointer;
padding: 0 0.5em;
unicode-bidi: embed;
visibility: hidden;
}
.tool.enabled {
visibility: visible;
}
.tool [data-i18n] {
font: 10px/12px sans-serif;
margin-top: 0.5em;
text-align: center;
}
body.no-tooltips .tool [data-i18n] {
display: none;
}
.statValue {
margin: 0;
}
#extraTools .fa-icon {
align-self: center;
position: relative;
}
#extraTools .fa-icon > .nope {
left: 50%;
position: absolute;
stroke: var(--fg-popup-icon-x);
stroke-width: 2;
transform: translateX(-50%);
visibility: hidden;
width: 1em;
}
#extraTools > span.on .fa-icon >.nope {
visibility: visible;
}
body:not(.dfEnabled) #moreButton .fa-icon {
transform: rotate(180deg);
}
#tooltip {
background-color: var(--bg-tooltip);
border: 1px solid gray;
border-radius: 3px;
box-shadow: 1px 1px 3px gray;
box-sizing: border-box;
color: var(--fg-tooltip);
cursor: pointer;
direction: ltr;
font: 12px sans-serif;
left: 5%;
line-height: 130%;
margin: 0.5em 0;
opacity: 0;
padding: 4px 6px;
pointer-events: none;
position: absolute;
text-align: center;
visibility: hidden;
white-space: pre-line;
width: 90%;
z-index: 100;
}
body[dir="rtl"] #tooltip {
direction: rtl;
}
#tooltip.show {
transition: opacity 0.15s 0.5s;
-webkit-transition: opacity 0.15s 0.5s;
visibility: visible;
opacity: 1;
}
#firewall {
border: 0;
flex-shrink: 0;
font-size: 90%;
margin: 0;
padding: 0;
overflow: hidden;
text-align: right;
}
body:not(.dfEnabled) #firewall {
display: none;
}
#firewall > div {
border: 0;
direction: ltr;
display: flex;
justify-content: flex-end;
margin: 0;
margin-top: 1px;
padding: 0;
}
#firewall > div:first-child {
margin-top: 0;
}
#firewall > div:first-child ~ div[data-des="*"] {
display: none;
}
#firewall:not(.expanded) > div.isSubDomain:not(.expandException):not(.isRootContext),
#firewall.expanded > div.isSubDomain.expandException:not(.isRootContext) {
display: none;
}
#firewall > div > span {
background-color: var(--bg-popup-cell-2);
border: none;
box-sizing: border-box;
-moz-box-sizing: border-box;
display: inline-flex;
padding: 0.4em 0;
position: relative;
}
#firewall > div:first-of-type > span:first-of-type {
cursor: pointer;
flex-direction: unset;
}
#firewall > div > span:first-of-type {
align-items: flex-end;
flex-direction: column;
flex-grow: 1;
justify-content: flex-end;
padding-right: 2px;
white-space: normal;
width: calc(100% - 5em);
word-break: break-word;
}
#firewall > div.isCname > span:first-of-type {
color: var(--fg-popup-cell-cname);
}
#firewall > div > span:first-of-type > sub {
display: inline-block;
font-size: 85%;
font-weight: normal;
padding: 0.25em 0 0 0;
}
#firewall > div > span:first-of-type > sub:empty {
display: none;
}
#firewall > div > span:first-of-type ~ span {
flex-shrink: 0;
margin-left: 1px;
width: 5em;
}
#firewall > div > span:nth-of-type(2) {
display: none;
}
#firewall > div > span:nth-of-type(3),
#firewall > div > span:nth-of-type(4) {
color: var(--fg-0-70);
display: none;
font-family: monospace;
text-align: center;
}
#firewall > div.isDomain > span:first-of-type {
font-weight: 600;
}
#firewall > div:first-of-type > span:first-of-type::before {
color: var(--fg-0-50);
content: '+';
padding-right: 0.25em;
}
#firewall.expanded > div:first-of-type > span:first-of-type::before {
content: '\2012';
}
#firewall > div[data-des="*"] > span:nth-of-type(3),
#firewall > div.isSubDomain > span:nth-of-type(3),
#firewall > div.isSubDomain.isRootContext > span:nth-of-type(3),
#firewall.expanded > div:not(.expandException) > span:nth-of-type(3),
#firewall:not(.expanded) > div.expandException > span:nth-of-type(3),
#firewall:not(.expanded) > div.isDomain:not(.expandException) > span:nth-of-type(4),
#firewall.expanded > div.isDomain.expandException > span:nth-of-type(4) {
display: inline-flex;
justify-content: space-between;
}
#firewall > div > span[data-acount]::before,
#firewall > div > span[data-bcount]::after,
#firewall > div > span[data-acount] > #actionSelector > #dynaCounts::before,
#firewall > div > span[data-acount] > #actionSelector > #dynaCounts::after {
content: ' ';
}
#firewall > div > span[data-acount]::before,
#firewall > div > span[data-acount] > #actionSelector > #dynaCounts::before {
padding-left: 0.1em;
}
#firewall > div > span[data-acount="1"]::before,
#firewall > div > span[data-acount="1"] > #actionSelector > #dynaCounts::before {
content: '+';
}
#firewall > div > span[data-acount="2"]::before,
#firewall > div > span[data-acount="2"] > #actionSelector > #dynaCounts::before {
content: '++';
}
#firewall > div > span[data-acount="3"]::before,
#firewall > div > span[data-acount="3"] > #actionSelector > #dynaCounts::before {
content: '+++';
}
#firewall > div > span[data-bcount]::after,
#firewall > div > span[data-bcount] > #actionSelector > #dynaCounts::after {
padding-right: 0.1em;
}
#firewall > div > span[data-bcount="1"]::after,
#firewall > div > span[data-bcount="1"] > #actionSelector > #dynaCounts::after {
content: '\2212';
}
#firewall > div > span[data-bcount="2"]::after,
#firewall > div > span[data-bcount="2"] > #actionSelector > #dynaCounts::after {
content: '\2212\2212';
}
#firewall > div > span[data-bcount="3"]::after,
#firewall > div > span[data-bcount="3"] > #actionSelector > #dynaCounts::after {
content: '\2212\2212\2212';
}
body.advancedUser #firewall > div > span:first-of-type {
width: calc(100% - 10em);
}
body.advancedUser #firewall > div > span:nth-of-type(2) {
display: inline-flex;
}
body.advancedUser #firewall > div:first-child ~ div[data-des="*"] {
display: flex;
}
body.advancedUser #firewall > div > span:first-of-type ~ span {
cursor: pointer;
}
/**
Small coloured label at the left of a row
*/
#firewall > div.isRootContext > span:first-of-type::before,
#firewall > div.allowed > span:first-of-type::before,
#firewall > div.blocked > span:first-of-type::before,
#firewall:not(.expanded) > div.isDomain.totalAllowed:not(.expandException) > span:first-of-type::before,
#firewall:not(.expanded) > div.isDomain.totalBlocked:not(.expandException) > span:first-of-type::before,
#firewall.expanded > div.isDomain.totalAllowed.expandException > span:first-of-type::before,
#firewall.expanded > div.isDomain.totalBlocked.expandException > span:first-of-type::before {
box-sizing: border-box;
content: '';
display: inline-block;
filter: var(--bg-popup-cell-label-filter);
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 7px;
}
#firewall > div.isRootContext > span:first-of-type::before {
background-color: var(--fg-0-50);
width: 14px !important;
}
#firewall > div.allowed > span:first-of-type::before,
#firewall > div.isDomain.totalAllowed > span:first-of-type::before {
background-color: var(--bg-popup-cell-allow-own);
}
#firewall > div.blocked > span:first-of-type::before,
#firewall > div.isDomain.totalBlocked > span:first-of-type::before {
background-color: var(--bg-popup-cell-block-own);
}
#firewall > div.allowed.blocked > span:first-of-type::before,
#firewall > div.isDomain.totalAllowed.totalBlocked > span:first-of-type::before {
background-color: var(--bg-popup-cell-label-mixed);
}
/* Rule cells */
body.advancedUser #firewall > div > span.allowRule,
#actionSelector > #dynaAllow {
background-color: var(--bg-popup-cell-allow);
}
body.advancedUser #firewall > div > span.blockRule,
#actionSelector > #dynaBlock {
background-color: var(--bg-popup-cell-block);
}
body.advancedUser #firewall > div > span.noopRule,
#actionSelector > #dynaNoop {
background-color: var(--bg-popup-cell-noop);
}
body.advancedUser #firewall > div > span.ownRule,
#firewall > div > span.ownRule {
color: var(--default-surface);
}
body.advancedUser #firewall > div > span.allowRule.ownRule,
#actionSelector > #dynaAllow:hover {
background-color: var(--bg-popup-cell-allow-own);
}
body.advancedUser #firewall > div > span.blockRule.ownRule,
#actionSelector > #dynaBlock:hover {
background-color: var(--bg-popup-cell-block-own);
}
body.advancedUser #firewall > div > span.noopRule.ownRule,
#actionSelector > #dynaNoop:hover {
background-color: var(--bg-popup-cell-noop-own);
}
#actionSelector {
box-sizing: border-box;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 1;
}
#actionSelector > span {
display: inline-block;
height: 100%;
}
#actionSelector > #dynaAllow {
width: 33%;
}
#actionSelector > #dynaNoop {
width: 33.5%;
}
#actionSelector > #dynaBlock {
width: 33.5%;
}
#actionSelector > #dynaCounts {
align-items: center;
background-color: transparent;
display: inline-flex;
height: 100%;
justify-content: space-between;
left: 0;
pointer-events: none;
position: absolute;
top: 0;
width: 100%;
}
/* mouse-driven devices */
:root.desktop body {
overflow: auto;
}
:root.desktop body.loading * {
visibility: hidden !important;
}
:root.desktop #panes {
flex-direction: row-reverse;
width: unset;
}
:root.desktop #main {
max-width: 300px;
width: max-content;
}
:root.desktop #firewall {
direction: rtl;
flex-grow: 1;
line-height: 1.4;
max-height: 540px;
min-height: 100vh;
min-width: 360px;
overflow-y: auto;
width: max-content;
}
:root.desktop .tool {
padding: 0.5em;
}
:root.desktop .tool:hover {
background-color: var(--bg-button);
}
:root.desktop .tool [data-i18n] {
/* display: none; */
width: min-content;
}