From a185b6b1823c8a76372a3ab13c2c015fa8d8671b Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Sat, 2 Dec 2017 18:55:23 -0500 Subject: [PATCH] Another popup mockup (#271) * Another popup mockup This is a fraction of what I want to do with the popup, but these are improvements that can be made to the existing version without a complete overhaul. Should be no difference appearance-wise, only some simple enhancements to existing functionality in terms of click area and stylability. Eliminates ill-conceived `.left-gutter` altogether. Checkboxes and labels are now either parent/child or siblings, with no weird spaces between them, and their hovers can therefore be styled together. `entry` checkbox/label `.style-name` now occupies the entire height/width of the `.entry` to the left of the `.actions` icons, so no more errant clicks. * Another popup mockup * Delete popup.css * Another popup mockup * Custom checkboxes * Custom checkboxes * Subtlety >an animated checkbox needlessly draws attention to itself But... I feel the need. Drawing attention to the checkbox is intentional to indicate click action. >In case the entire row is highlighted there will be no distraction Clickable area isn't the entire row, it's everything left of action icons. Hovering background on part of the row will look odd, and it's also a less obvious indicator of click action IMO. Didn't change "disable all" yet. It's a special kinda function, so maybe slightly more drastic is warranted, but I can tone that down too. --- popup.html | 46 ++++++------- popup/popup.css | 169 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 157 insertions(+), 58 deletions(-) diff --git a/popup.html b/popup.html index 4df2ce89..5e02bfb6 100644 --- a/popup.html +++ b/popup.html @@ -23,25 +23,27 @@ @@ -108,14 +110,14 @@
-
- -
+ + + +
-
div:not(#installed) { - margin-left: 0.75em; - margin-right: 0.75em; + margin-left: 9px; + margin-right: 9px; } .firefox .chromium-only { display: none; } -input[type=checkbox] { +.svg-icon.checked { + position: absolute; + height: 8px; + width: 8px; + display: none; + fill: #000; + margin: 2px 0 0 2px; +} + +input[type="checkbox"]:checked + .svg-icon.checked { + display: inline-flex; + transition: fill .25s; +} + +input[type="checkbox"] { + -moz-appearance: none; + -webkit-appearance: none; + border: 1px solid hsl(0, 0%, 46%); + height: 12px; + width: 12px; + display: inline-flex; + border-radius: 2px; + background-color: hsl(0, 0%, 94%); outline: none; + margin: 0; + transition: background-color .25s, border-color .25s; +} + +input[type="checkbox"]:checked:hover, .style-name:hover input[type="checkbox"]:checked { + border-color: hsl(0, 0%, 32%); + background-color: hsl(0, 0%, 82%); +} + +input[type="checkbox"]:hover, .style-name:hover input[type="checkbox"], +.entry.disabled .style-name:hover input[type="checkbox"] { + border-color: hsl(0, 0%, 32%); + background-color: hsl(0, 0%, 82%); +} + +#installed.disabled + .actions #disableAll:checked + .svg-icon.checked { + fill: hsl(0, 68%, 42%); +} + +#installed.disabled + .actions #disableAll:checked { + border-color: hsl(0, 68%, 50%); +} + +#installed.disabled + .actions #disableAll:checked:hover + .svg-icon.checked { + fill: #fff; +} + +#disableAll:hover { + border-color: hsl(0, 68%, 50%); + background-color: hsl(20, 70%, 75%); +} + +#disableAll:hover + .svg-icon + label { + color: hsl(0, 68%, 42%); +} + +#installed.disabled + .actions #disableAll:checked:hover { + border-color: hsl(0, 50%, 56%); + background-color: hsl(0, 50%, 56%); +} + +.style-name .checker, +.style-name .svg-icon.checked { + position: absolute; + top: 7px; + left: 9px; + pointer-events: none; +} + +#disable-all-wrapper .main-controls .svg-icon.checked { + position: absolute; + top: 0; + left: 0; + pointer-events: none; +} + +label { + transition: color .25s; } #disable-all-wrapper { padding: 0.3em 0 0.6em; } +#disable-all-wrapper .main-controls { + display: flex; + position: relative; +} + +#disable-all-wrapper .main-controls label { + font-size: 12px; + padding-left: 4px; +} + #no-styles { font-style: italic; } @@ -39,12 +129,6 @@ input[type=checkbox] { display: inline; } -.style-name { - cursor: default; - font-weight: bold; - display: block; -} - a { color: #000; transition: color .5s; @@ -55,16 +139,8 @@ a:hover { color: #666; } -.left-gutter { - display: table-cell; - width: 16px; - vertical-align: top; -} - -.left-gutter input { - margin-bottom: 1px; - margin-top: 0; - margin-left: 0; +.actions > .main-controls { + padding-left: 16px; } .main-controls { @@ -108,10 +184,46 @@ body.blocked > DIV { .entry { display: flex; align-items: center; - padding: 5px 0.75em; + height: 26px; + padding: 0 14px 0 0; position: relative; } +html[style] .entry { + padding: 0 16px 0 0; +} + +html[style] .entry:nth-child(-n+10):before, +html[style] .entry:nth-child(10):before { + right: 7px; +} + +.entry .actions { + display: inline-flex; +} + +.style-name { + height: 100%; + width: 100%; + line-height: 28px; + cursor: default; + font-weight: bold; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-left: 26px; + position: relative; +} + +.entry .main-controls { + height: 100%; + display: inline-flex; + flex-grow: 1; + overflow: hidden; + align-items: center; + padding-right: 5px; +} + .entry:nth-child(even) { background-color: rgba(0, 0, 0, 0.05); } @@ -140,20 +252,6 @@ body.blocked > DIV { padding: 0 1px 0; } -.entry .main-controls { - display: flex; - width: calc(100% - 20px); - align-items: center; -} - -.entry .main-controls label { - flex: 1; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - padding-right: 5px; -} - .not-applied .checker, .not-applied .style-name, .not-applied .actions > * { @@ -253,8 +351,7 @@ body > .actions { } body.blocked #installed > *, -body.blocked .actions > .main-controls, -body.blocked .actions > .left-gutter { +body.blocked .actions > .main-controls { display: none; }