]> git.gir.st - VimFx.git/blob - extension/skin/style.css
Add `gulp hints.html` to help styling hint markers
[VimFx.git] / extension / skin / style.css
1 /*
2 * Copyright Simon Lydell 2015, 2016.
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,hints}.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 {
46 list-style-image: url(icon32.png);
47 }
48
49 #main-window[vimfx-mode="ignore"] #VimFxButton {
50 list-style-image: url(icon32-red.png);
51 }
52
53 #VimFxButton[cui-areatype="menu-panel"],
54 toolbarpaletteitem[place="palette"] > #VimFxButton {
55 list-style-image: url(icon64.png);
56 }
57
58 #main-window[vimfx-mode="ignore"] #VimFxButton[cui-areatype="menu-panel"],
59 #main-window[vimfx-mode="ignore"] toolbarpaletteitem[place="palette"] > #VimFxButton {
60 list-style-image: url(icon64-red.png);
61 }
62 }
63
64 #main-window:-moz-any(
65 [vimfx-mode="normal"][vimfx-focus-type="editable"],
66 [vimfx-mode="find"][vimfx-focus-type="findbar"]
67 ) #VimFxButton image {
68 filter: grayscale(100%) brightness(150%);
69 }
70
71
72
73 /* All styles below are intentionally very generic to fit with the user’s system
74 * and preferences. */
75
76
77
78 /***** Markers *****/
79
80 #VimFxMarkersContainer {
81 position: absolute;
82 pointer-events: none;
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
159 opacity: 0.92;
160 background-color: Window;
161 color: WindowText;
162 font: menu;
163 /* Some light-weight themes set a `text-shadow` that the hint markers inherit,
164 * making them almost unreadable. */
165 text-shadow: none;
166 cursor: default;
167
168 --page-padding: 3em;
169 --gutter: 1em;
170 }
171
172 #VimFxHelpDialogContainer .wrapper {
173 position: absolute;
174 top: 0;
175 bottom: 0;
176 left: 0;
177 right: 0;
178 overflow-y: auto;
179 overflow-x: hidden;
180 padding-top: calc(var(--page-padding) / 2);
181 padding-left: calc(var(--page-padding) - var(--gutter));
182 padding-right: var(--page-padding);
183 }
184
185 #VimFxHelpDialogContainer .vimfx-box {
186 display: block;
187 }
188
189 #VimFxHelpDialogContainer :-moz-any(.heading-mode, .heading-category, .key-sequence) {
190 font-weight: bold;
191 white-space: nowrap;
192 }
193
194
195 #VimFxHelpDialogContainer .header {
196 position: relative;
197 margin-left: var(--gutter);
198 margin-bottom: calc(var(--page-padding) / 4);
199 font-weight: bold;
200 }
201
202 #VimFxHelpDialogContainer .heading-main {
203 font-size: 4.2em;
204 /* Add space for the close button. */
205 margin-right: 0.4em;
206 }
207
208 #VimFxHelpDialogContainer .logo {
209 display: inline;
210 margin-right: 0.5ch;
211 color: #349938;
212 font-family: Helvetica, Arial, Verdana, sans-serif;
213 font-style: italic;
214 letter-spacing: -0.035em;
215 text-shadow: 0.04em 0.02em black;
216 }
217
218 #VimFxHelpDialogContainer .logo::before {
219 content: 'ım';
220 margin-left: -0.15em;
221 padding-left: 1.67ch;
222 background: url(icon128.png) no-repeat;
223 background-size: contain;
224 }
225
226 #VimFxHelpDialogContainer .logo::after {
227 content: 'Fx';
228 color: #d37826;
229 }
230
231 #VimFxHelpDialogContainer .title {
232 display: inline-block;
233 font-size: 1.4ex;
234 line-height: 1.2;
235 }
236
237 #VimFxHelpDialogContainer .close-button {
238 position: absolute;
239 right: 0;
240 top: 0;
241 font-size: 3em;
242 -moz-user-select: none;
243 }
244
245 #VimFxHelpDialogContainer .close-button:hover {
246 cursor: pointer;
247 }
248
249 #VimFxHelpDialogContainer .content {
250 display: flex;
251 flex-wrap: wrap;
252 }
253
254 #VimFxHelpDialogContainer .category {
255 flex: 1 16em;
256 margin-left: var(--gutter);
257 margin-bottom: calc(var(--page-padding) / 2);
258 }
259
260 #VimFxHelpDialogContainer :-moz-any([data-mode="find"], [data-mode="marks"]) {
261 display: none;
262 }
263
264 #VimFxHelpDialogContainer .heading-mode,
265 #VimFxHelpDialogContainer .category:not(.first)::before {
266 font-size: 2em;
267 }
268
269 #VimFxHelpDialogContainer .category:not(.first)::before {
270 /* Insert newline the same size as a `.heading-mode` to vertically align all
271 * `.heading-category`s. */
272 content: "\A";
273 white-space: pre;
274 }
275
276 #VimFxHelpDialogContainer .heading-category {
277 font-size: 1.5em;
278 }
279
280 #VimFxHelpDialogContainer .command {
281 float: left;
282 clear: left;
283 width: 100%;
284 margin-top: 0.2em;
285 }
286
287 #VimFxHelpDialogContainer .command.has-click {
288 cursor: pointer;
289 }
290
291 #VimFxHelpDialogContainer .command.has-click:hover * {
292 text-decoration: underline;
293 }
294
295 #VimFxHelpDialogContainer .key-sequence {
296 float: left;
297 margin-right: 1.7ch;
298 }
299
300 #VimFxHelpDialogContainer .key-sequence:last-of-type {
301 margin-right: 0.7ch;
302 }
303
304 #VimFxHelpDialogContainer .key-sequence-special-keys {
305 /* The special keys are not helpful in the help dialog. If somebody
306 * disagrees, they can simply re-show them with custom CSS. */
307 display: none;
308 }
309
310 #VimFxHelpDialogContainer .key-sequence-rest {
311 display: inline;
312 }
313
314 #VimFxHelpDialogContainer .description {
315 float: right;
316 width: calc(100% - 3.7em);
317 }
318
319 #VimFxHelpDialogContainer .search-input {
320 position: absolute;
321 right: 0;
322 bottom: 0;
323 }
324
325 #VimFxHelpDialogContainer .search-input:not([focused="true"]) {
326 opacity: 0;
327 pointer-events: none;
328 }
329
330 #VimFxHelpDialogContainer .search-match {} /* Keep as documentation. */
331
332 #VimFxHelpDialogContainer .search-non-match {
333 opacity: 0.2;
334 }
335
336 #VimFxHelpDialogContainer .search-highlight {
337 display: inline;
338 background-color: Highlight;
339 color: HighlightText;
340 }
341
342 }
Imprint / Impressum