Skip to content

Commit 6f8da6e

Browse files
Full flex popup
1 parent 3c89cac commit 6f8da6e

File tree

2 files changed

+188
-90
lines changed

2 files changed

+188
-90
lines changed

popup/popup.css

Lines changed: 184 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,88 @@
1+
html, body {
2+
height: min-content;
3+
}
4+
15
body {
2-
width: 252px;
6+
display: flex;
7+
flex-direction: row;
8+
flex-wrap: wrap;
9+
justify-content: space-between;
10+
padding: 0 9px 9px;
311
font-size: 12px;
412
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
513
margin: 0;
614
}
15+
716
.firefox body {
817
background-color: #fff;
918
}
1019

11-
body > div:not(#installed) {
12-
margin-left: 0.75em;
13-
margin-right: 0.75em;
20+
.firefox .chromium-only {
21+
display: none;
1422
}
1523

16-
.firefox .chromium-only {
24+
.svg-icon.checked {
25+
position: absolute;
26+
height: 8px;
27+
width: 8px;
1728
display: none;
29+
fill: #000;
30+
margin: 2px 0 0 2px;
1831
}
1932

20-
input[type=checkbox] {
33+
input[type="checkbox"]:checked:hover + .svg-icon.checked,
34+
.style-name:hover input[type="checkbox"]:checked + .svg-icon.checked {
35+
fill: #666;
36+
}
37+
38+
input[type="checkbox"]:checked + .svg-icon.checked {
39+
display: inline-flex;
40+
}
41+
42+
input[type="checkbox"],
43+
.entry.disabled:not(.not-applied) .style-name:hover input[type="checkbox"] {
44+
-moz-appearance: none;
45+
-webkit-appearance: none;
46+
border: 1px solid hsl(0, 0%, 20%);
47+
height: 12px;
48+
width: 12px;
49+
display: inline-flex;
50+
border-radius: 2px;
51+
background-color: hsl(0, 0%, 94%);
2152
outline: none;
53+
margin: 0;
54+
transition: background-color .5s, border-color .5s;
2255
}
2356

24-
#disable-all-wrapper {
25-
padding: 0.3em 0 0.6em;
57+
input[type="checkbox"]:hover, .style-name:hover input[type="checkbox"] {
58+
background-color: hsl(0, 0%, 100%);
59+
border-color: hsl(0, 0%, 50%);
2660
}
2761

28-
#no-styles {
29-
font-style: italic;
62+
.entry.disabled:not(.not-applied) input[type="checkbox"],
63+
.entry.not-applied input[type="checkbox"],
64+
.entry.disabled:not(.not-applied) input[type="checkbox"] + .svg-icon.checked,
65+
.entry.not-applied input[type="checkbox"] + .svg-icon.checked,
66+
.entry.disabled:not(.not-applied) .style-name,
67+
.entry.not-applied .style-name {
68+
transition: none;
3069
}
3170

32-
.checker {
33-
display: inline;
71+
.entry.disabled:not(.not-applied) .style-name:hover .style-name-span {
72+
color: #000;
3473
}
3574

36-
.style-name {
37-
cursor: default;
38-
font-weight: bold;
39-
display: block;
75+
a:hover, input[type="checkbox"]:hover + .svg-icon + label {
76+
color: #666;
77+
}
78+
79+
label {
80+
color: #000;
81+
transition: color .5s;
82+
}
83+
84+
#no-styles {
85+
font-style: italic;
4086
}
4187

4288
a {
@@ -50,19 +96,11 @@ a:hover {
5096
}
5197

5298
.left-gutter {
53-
display: table-cell;
54-
width: 16px;
55-
vertical-align: top;
99+
display: inline-flex;
56100
}
57101

58-
.left-gutter input {
59-
margin-bottom: 1px;
60-
margin-top: 0;
61-
margin-left: 0;
62-
}
63-
64-
.main-controls {
65-
display: table-cell;
102+
.style-name .left-gutter {
103+
pointer-events: none;
66104
}
67105

68106
body > DIV:last-of-type,
@@ -71,19 +109,19 @@ body.blocked > DIV {
71109
}
72110

73111
#installed {
74-
border-bottom: 1px solid black;
112+
border-bottom: 1px solid #000;
75113
padding-bottom: 2px;
76114
padding-top: 2px;
115+
margin: 0 -9px;
116+
flex-grow: 1;
117+
width: 100%;
77118
max-height: 445px;
78119
overflow-y: auto;
79120
}
80121

81-
#installed.disabled .style-name {
82-
text-decoration: line-through;
83-
}
84-
85122
#installed .actions {
86123
cursor: default;
124+
display: inline-flex;
87125
}
88126

89127
#installed .actions a {
@@ -96,7 +134,8 @@ body.blocked > DIV {
96134
.entry {
97135
display: flex;
98136
align-items: center;
99-
padding: 5px 0.75em;
137+
padding: 0 9px;
138+
height: 26px;
100139
}
101140

102141
.entry:nth-child(even) {
@@ -109,39 +148,85 @@ body.blocked > DIV {
109148

110149
.entry .style-edit-link,
111150
.entry .delete {
112-
display: inline-block;
113-
padding: 0 1px 0;
151+
display: inline-flex;
152+
height: 24px;
153+
width: 18px;
154+
align-items: center;
155+
justify-content: center;
114156
}
115157

116158
.entry .main-controls {
159+
display: inline-flex;
160+
align-items: center;
161+
flex-grow: 1;
162+
overflow: hidden;
163+
padding-right: 5px;
164+
165+
}
166+
167+
.entry .main-controls .style-name {
117168
display: flex;
118-
width: calc(100% - 20px);
169+
flex-grow: 1;
170+
overflow: hidden;
171+
height: 100%;
119172
align-items: center;
120173
}
121174

122-
.entry .main-controls label {
123-
flex: 1;
175+
.entry .main-controls .style-name-span{
176+
cursor: default;
177+
font-weight: bold;
124178
overflow: hidden;
125-
text-overflow: ellipsis;
126179
white-space: nowrap;
127-
padding-right: 5px;
180+
text-overflow: ellipsis;
181+
margin: 1px 0 0 4px;
182+
pointer-events: none;
183+
}
184+
185+
.entry.disabled:not(.not-applied) .style-name,
186+
.entry.disabled:not(.not-applied) .actions,
187+
.entry.not-applied .style-name,
188+
.entry.not-applied .actions {
189+
opacity: .4;
190+
transition: opacity .5s ease-in-out .25s;
128191
}
129192

130-
.not-applied .checker,
131-
.not-applied .style-name,
132-
.not-applied .actions > * {
193+
#installed.disabled {
133194
opacity: .2;
134-
transition: opacity .5s ease-in-out .25s, color .5s ease-in-out .25s;
195+
transition: opacity .5s ease-in-out .25s;
196+
}
197+
198+
#installed.disabled:hover,
199+
#installed.disabled:not(:hover) .entry.disabled:not(.not-applied) .style-name,
200+
#installed.disabled:not(:hover) .entry.disabled:not(.not-applied) .actions,
201+
#installed.disabled:not(:hover) .entry.not-applied .style-name,
202+
#installed.disabled:not(:hover) .entry.not-applied .actions,
203+
.entry.not-applied:hover .style-name,
204+
.entry.not-applied:hover .actions,
205+
.entry.disabled:not(.not-applied):hover .style-name,
206+
.entry.disabled:not(.not-applied):hover .actions {
207+
opacity: 1;
135208
}
136209

137-
.not-applied:hover .checker,
138-
.not-applied:hover .style-name,
139-
.not-applied:hover .actions > * {
140-
opacity: 1;
210+
.not-applied .style-name, .not-applied .style-name-span {
211+
color: hsl(0, 100%, 30%);
212+
}
213+
214+
.entry.not-applied .svg-icon, .not-applied input[type="checkbox"]:checked + .svg-icon.checked,
215+
.entry.not-applied .style-name:hover input[type="checkbox"]:checked + .svg-icon.checked {
216+
fill: hsl(0, 100%, 30%);
217+
}
218+
219+
.entry.not-applied a:hover .svg-icon.remove {
220+
fill: hsl(0, 100%, 50%);
141221
}
142222

143-
.not-applied:hover .style-name {
144-
color: darkred;
223+
.entry.not-applied a:hover .svg-icon.edit {
224+
fill: hsl(170, 70%, 38%);
225+
}
226+
227+
.entry.not-applied input[type="checkbox"], .entry.not-applied .style-name:hover input[type="checkbox"] {
228+
background-color: hsl(0, 0%, 100%);
229+
border-color: hsl(0, 100%, 30%);
145230
}
146231

147232
.regexp-problem-indicator {
@@ -180,6 +265,14 @@ body.blocked > DIV {
180265
z-index: 999999;
181266
}
182267

268+
#regexp-explanation button {
269+
max-width: 100%;
270+
white-space: nowrap;
271+
overflow: hidden;
272+
text-overflow: ellipsis;
273+
margin: auto;
274+
}
275+
183276
#regexp-explanation > div {
184277
display: none;
185278
list-style-type: none;
@@ -208,20 +301,6 @@ a:hover .svg-icon {
208301
fill: #000;
209302
}
210303

211-
body > .actions {
212-
margin-top: 0.5em;
213-
}
214-
215-
.actions > div:not(:last-child):not(#disable-all-wrapper),
216-
.actions > .main-controls > div:not(:last-child) {
217-
margin-bottom: 0.75em;
218-
}
219-
220-
.actions input,
221-
.actions label {
222-
vertical-align: middle;
223-
}
224-
225304
body.blocked #installed > *,
226305
body.blocked .actions > .main-controls,
227306
body.blocked .actions > .left-gutter {
@@ -257,9 +336,8 @@ body.blocked .actions > .left-gutter {
257336

258337
#match {
259338
overflow-wrap: break-word;
260-
display: block;
261-
flex-grow: 9;
262-
min-width: 200px;
339+
flex-grow: 1;
340+
min-width: 100%;
263341
}
264342

265343
/* "breadcrumbs" 'new style' links */
@@ -310,26 +388,39 @@ body.blocked .actions > .left-gutter {
310388
text-decoration-skip: ink;
311389
}
312390

313-
/* action buttons */
314-
315-
#popup-options {
316-
display: flex;
317-
flex-direction: row;
318-
justify-content: space-between;
319-
padding: 1.2em 1px;
320-
}
391+
/* actions/buttons and wrappers */
321392

322-
#popup-options button {
323-
width: 32%;
393+
#popup-manage-button, #popup-shortcuts-button, #popup-options-button {
394+
width: 100%;
324395
white-space: nowrap;
325396
overflow: hidden;
326397
text-overflow: ellipsis;
327398
}
328399

400+
#popup-manage-wrapper, #popup-shortcuts-wrapper, #popup-options-wrapper {
401+
width: 32%;
402+
}
403+
329404
.firefox #popup-options button {
330-
width: 49%;
405+
width: 48%;
406+
}
407+
408+
#disable-all-wrapper, #write-style-wrapper, #find-styles-wrapper {
409+
width: 100%;
410+
}
411+
#disable-all-wrapper {
412+
padding: 12px 0;
413+
}
414+
415+
#write-style-wrapper, #find-styles-wrapper {
416+
padding: 0 0 12px;
331417
}
332418

419+
#disableAll-label {
420+
padding-left: 4px;
421+
}
422+
423+
333424
/* confirm */
334425

335426
#confirm {
@@ -379,18 +470,28 @@ body.blocked .actions > .left-gutter {
379470
}
380471

381472
#confirm > div > div {
382-
text-align: center;
473+
display: flex;
474+
justify-content: center;
383475
}
384476

385477
.non-windows #confirm > div > div {
386478
direction: rtl;
387479
text-align: right;
388480
}
389481

390-
#confirm > button {
391-
/* add a gap between buttons both for horizontal
392-
or vertical (when the label is wide) layout */
393-
margin: 0 .25em .25em 0;
482+
#confirm button {
483+
max-width: calc(50% - 9px);
484+
white-space: nowrap;
485+
overflow: hidden;
486+
text-overflow: ellipsis;
487+
}
488+
489+
#confirm button:first-of-type {
490+
margin-right: 3px;
491+
}
492+
493+
#confirm button:nth-of-type(2) {
494+
margin-left: 3px;
394495
}
395496

396497
.unreachable .entry {

0 commit comments

Comments
 (0)