]> git.gir.st - VimFx.git/blob - extension/skin/style.css
Improve the help dialog UX
[VimFx.git] / extension / skin / style.css
1 /*
2 * Copyright Simon Lydell 2015.
3 *
4 * This file is part of VimFx.
5 *
6 * VimFx is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * VimFx is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with VimFx. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 /* Allow file:/// prefix for testing using `gulp help.html`. */
21 @-moz-document url(chrome://browser/content/browser.xul), url-prefix(file:///)
22 {
23
24 /***** Button *****/
25
26 #VimFxButton {
27 list-style-image: url(icon16.png);
28 }
29
30 #main-window[vimfx-mode="ignore"] #VimFxButton {
31 list-style-image: url(icon16-red.png);
32 }
33
34 #VimFxButton[cui-areatype="menu-panel"],
35 toolbarpaletteitem[place="palette"] > #VimFxButton {
36 list-style-image: url(icon32.png);
37 }
38
39 #main-window[vimfx-mode="ignore"] #VimFxButton[cui-areatype="menu-panel"],
40 #main-window[vimfx-mode="ignore"] toolbarpaletteitem[place="palette"] > #VimFxButton {
41 list-style-image: url(icon32-red.png);
42 }
43
44 @media (min-resolution: 2dppx) {
45 #VimFxButton image {
46 width: 32px;
47 }
48
49 #VimFxButton {
50 list-style-image: url(icon32.png);
51 }
52
53 #main-window[vimfx-mode="ignore"] #VimFxButton {
54 list-style-image: url(icon32-red.png);
55 }
56
57 #VimFxButton[cui-areatype="menu-panel"],
58 toolbarpaletteitem[place="palette"] > #VimFxButton {
59 list-style-image: url(icon64.png);
60 }
61
62 #main-window[vimfx-mode="ignore"] #VimFxButton[cui-areatype="menu-panel"],
63 #main-window[vimfx-mode="ignore"] toolbarpaletteitem[place="palette"] > #VimFxButton {
64 list-style-image: url(icon64-red.png);
65 }
66 }
67
68 #main-window[vimfx-mode="normal"][vimfx-focus-type="editable"] #VimFxButton image {
69 filter: grayscale(100%) brightness(150%);
70 }
71
72
73
74 /* All styles below are intentionally very generic to fit with the user’s system
75 * and preferences. */
76
77
78
79 /***** Markers *****/
80
81 #VimFxMarkersContainer {
82 position: absolute;
83 }
84
85 #VimFxMarkersContainer.ui {
86 position: fixed;
87 top: 0;
88 left: 0;
89 width: 100%;
90 height: 100%;
91 z-index: 9999;
92 }
93
94 /* Marker styles should be kept simple for performance. */
95 #VimFxMarkersContainer .marker {
96 position: absolute;
97 --padding: 0.2em;
98 padding: var(--padding);
99 --border-color: #ad810c;
100 --border-width: 1px;
101 border: solid var(--border-width) var(--border-color);
102 background-color: #ffd76e;
103 color: #302505;
104 font: menu;
105 line-height: 1;
106 font-weight: bold;
107 text-transform: uppercase;
108 white-space: nowrap;
109 /* Some light-weight themes set a `text-shadow` that the hint markers inherit,
110 * making them almost unreadable. */
111 text-shadow: none;
112 }
113
114 #VimFxMarkersContainer .marker-char {} /* Keep as documentation. */
115
116 #VimFxMarkersContainer .marker--matched,
117 #VimFxMarkersContainer .marker-char--matched {
118 color: #ffa22a;
119 }
120
121 #VimFxMarkersContainer .marker--hidden {
122 display: none;
123 }
124
125 /* alt, ctrl and meta can also be targeted. */
126 #main-window[vimfx-held-modifiers~="shift"] #VimFxMarkersContainer {
127 opacity: 0.2;
128 }
129
130 #VimFxMarkersContainer .marker[data-type="scrollable"] {
131 --width: 1px;
132 padding-right: calc(var(--padding) + var(--border-width) + var(--width));
133 }
134
135 #VimFxMarkersContainer .marker[data-type="scrollable"]::after {
136 content: '';
137 position: absolute;
138 top: 0;
139 right: 0;
140 height: 100%;
141 width: var(--width);
142 border-left: inherit;
143 background-image: linear-gradient(
144 to bottom,
145 transparent 15%,
146 var(--border-color) 0,
147 var(--border-color) 75%,
148 transparent 0
149 );
150 }
151
152
153
154 /***** Help Dialog *****/
155
156 #VimFxHelpDialogContainer {
157 position: absolute;
158 overflow-y: auto;
159 overflow-x: hidden;
160
161 opacity: 0.92;
162 background-color: Window;
163 color: WindowText;
164 font: menu;
165 /* Some light-weight themes set a `text-shadow` that the hint markers inherit,
166 * making them almost unreadable. */
167 text-shadow: none;
168 cursor: default;
169
170 --page-padding: 3em;
171 --gutter: 1em;
172 padding-top: calc(var(--page-padding) / 2);
173 padding-left: calc(var(--page-padding) - var(--gutter));
174 padding-right: var(--page-padding);
175 }
176
177 #VimFxHelpDialogContainer .vimfx-box {
178 display: block;
179 }
180
181 #VimFxHelpDialogContainer :-moz-any(.heading-mode, .heading-category, .key-sequence) {
182 font-weight: bold;
183 white-space: nowrap;
184 }
185
186
187 #VimFxHelpDialogContainer .header {
188 position: relative;
189 margin-left: var(--gutter);
190 margin-bottom: calc(var(--page-padding) / 4);
191 font-weight: bold;
192 }
193
194 #VimFxHelpDialogContainer .heading-main {
195 font-size: 4.2em;
196 /* Add space for the close button. */
197 margin-right: 0.4em;
198 }
199
200 #VimFxHelpDialogContainer .logo {
201 display: inline;
202 margin-right: 0.5ch;
203 color: #349938;
204 font-style: italic;
205 letter-spacing: -0.06em;
206 text-shadow: 0.04em 0.02em black;
207 }
208
209 #VimFxHelpDialogContainer .logo::before {
210 content: 'ım';
211 margin-left: -0.15em;
212 padding-left: 1.34ch;
213 background: url(icon128.png) no-repeat;
214 background-size: contain;
215 }
216
217 #VimFxHelpDialogContainer .logo::after {
218 content: 'Fx';
219 color: #d37826;
220 }
221
222 #VimFxHelpDialogContainer .title {
223 display: inline-block;
224 font-size: 1.4ex;
225 line-height: 1.2;
226 }
227
228 #VimFxHelpDialogContainer .close-button {
229 position: absolute;
230 right: 0;
231 top: 0;
232 font-size: 3em;
233 -moz-user-select: none;
234 }
235
236 #VimFxHelpDialogContainer .close-button:hover {
237 cursor: pointer;
238 }
239
240 #VimFxHelpDialogContainer .content {
241 display: flex;
242 flex-wrap: wrap;
243 }
244
245 #VimFxHelpDialogContainer .category {
246 flex: 1 16em;
247 margin-left: var(--gutter);
248 margin-bottom: calc(var(--page-padding) / 2);
249 }
250
251 #VimFxHelpDialogContainer .heading-mode,
252 #VimFxHelpDialogContainer .category:not(.first)::before {
253 font-size: 2em;
254 }
255
256 #VimFxHelpDialogContainer .category:not(.first)::before {
257 /* Insert newline the same size as a `.heading-mode` to vertically align all
258 * `.heading-category`s. */
259 content: "\A";
260 white-space: pre;
261 }
262
263 #VimFxHelpDialogContainer .heading-category {
264 font-size: 1.5em;
265 }
266
267 #VimFxHelpDialogContainer .command {
268 float: left;
269 clear: left;
270 width: 100%;
271 margin-top: 0.2em;
272 }
273
274 #VimFxHelpDialogContainer .key-sequence {
275 float: left;
276 margin-right: 1.7ch;
277 }
278
279 #VimFxHelpDialogContainer .key-sequence:last-of-type {
280 margin-right: 0.7ch;
281 }
282
283 #VimFxHelpDialogContainer .key-sequence-special-keys {
284 /* The special keys are not helpful in the help dialog. If somebody
285 * disagrees, they can simply re-show them with custom CSS. */
286 display: none;
287 }
288
289 #VimFxHelpDialogContainer .key-sequence-rest {
290 display: inline;
291 }
292
293 #VimFxHelpDialogContainer .description {
294 float: right;
295 /* The space to the left should be wide enough to fit `<c-w>`. */
296 width: calc(100% - 3.5em);
297 }
298
299 #VimFxHelpDialogContainer .search-input {
300 position: fixed;
301 right: 0;
302 bottom: 0;
303 }
304
305 #VimFxHelpDialogContainer .search-input:not([focused="true"]) {
306 opacity: 0;
307 pointer-events: none;
308 }
309
310 #VimFxHelpDialogContainer .search-match {} /* Keep as documentation. */
311
312 #VimFxHelpDialogContainer .search-non-match {
313 opacity: 0.2;
314 }
315
316 #VimFxHelpDialogContainer .search-highlight {
317 display: inline;
318 background-color: Highlight;
319 color: HighlightText;
320 }
321
322 }
Imprint / Impressum