]> git.gir.st - VimFx.git/blob - extension/skin/style.css
Simplify styling for highlighted 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 font: menu;
84 }
85
86 #VimFxMarkersContainer.ui {
87 position: fixed;
88 top: 0;
89 left: 0;
90 width: 100%;
91 height: 100%;
92 z-index: 9999;
93 }
94
95 /* Marker styles should be kept simple for performance. */
96 #VimFxMarkersContainer .marker {
97 position: absolute;
98 --padding: 0.2em;
99 padding: var(--padding);
100 --border-color: rgba(0, 0, 0, 0.4);
101 --border-width: 1px;
102 border: solid var(--border-width) var(--border-color);
103 background-color: #ffd76e;
104 color: black;
105 font-size: 0.8em;
106 line-height: 1;
107 font-weight: bold;
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:not(.has-mixedcase) .marker {
115 text-transform: uppercase;
116 }
117
118 #VimFxMarkersContainer .marker-char {} /* Keep as documentation. */
119
120 #VimFxMarkersContainer .marker--matched,
121 #VimFxMarkersContainer .marker-char--matched {
122 color: rgba(0, 0, 0, 0.3);
123 }
124
125 #VimFxMarkersContainer .marker--highlighted {
126 background-color: lime;
127 }
128
129 #VimFxMarkersContainer .marker--hidden {
130 display: none;
131 }
132
133 /* alt, ctrl, meta and shift can be targeted. */
134 #main-window[vimfx-held-modifiers~="ctrl"][vimfx-held-modifiers~="shift"]
135 #VimFxMarkersContainer {
136 opacity: 0.2;
137 }
138
139 #VimFxMarkersContainer .marker[data-type="scrollable"] {
140 --width: 0.17em;
141 padding-right: calc(var(--padding) + var(--border-width) + var(--width));
142 }
143
144 #VimFxMarkersContainer .marker[data-type="scrollable"]::after {
145 content: '';
146 position: absolute;
147 top: 0;
148 right: 0;
149 height: 100%;
150 width: var(--width);
151 border-left: inherit;
152 background-image: linear-gradient(
153 to bottom,
154 transparent 15%,
155 var(--border-color) 0,
156 var(--border-color) 75%,
157 transparent 0
158 );
159 }
160
161
162
163 /***** Help Dialog *****/
164
165 #VimFxHelpDialogContainer {
166 position: absolute;
167
168 opacity: 0.92;
169 background-color: Window;
170 color: WindowText;
171 font: menu;
172 /* Some light-weight themes set a `text-shadow` that the hint markers inherit,
173 * making them almost unreadable. */
174 text-shadow: none;
175 cursor: default;
176
177 --page-padding: 3em;
178 --gutter: 1em;
179 }
180
181 #VimFxHelpDialogContainer .wrapper {
182 position: absolute;
183 top: 0;
184 bottom: 0;
185 left: 0;
186 right: 0;
187 overflow-y: auto;
188 overflow-x: hidden;
189 padding-top: calc(var(--page-padding) / 2);
190 padding-left: calc(var(--page-padding) - var(--gutter));
191 padding-right: var(--page-padding);
192 }
193
194 #VimFxHelpDialogContainer .vimfx-box {
195 display: block;
196 }
197
198 #VimFxHelpDialogContainer :-moz-any(.heading-mode, .heading-category, .key-sequence) {
199 font-weight: bold;
200 white-space: nowrap;
201 }
202
203
204 #VimFxHelpDialogContainer .header {
205 position: relative;
206 margin-left: var(--gutter);
207 margin-bottom: calc(var(--page-padding) / 4);
208 font-weight: bold;
209 }
210
211 #VimFxHelpDialogContainer .heading-main {
212 font-size: 4.2em;
213 /* Add space for the close button. */
214 margin-right: 0.4em;
215 }
216
217 #VimFxHelpDialogContainer .logo {
218 display: inline;
219 margin-right: 0.5ch;
220 color: #349938;
221 font-family: Helvetica, Arial, Verdana, sans-serif;
222 font-style: italic;
223 letter-spacing: -0.035em;
224 text-shadow: 0.04em 0.02em black;
225 }
226
227 #VimFxHelpDialogContainer .logo::before {
228 content: 'ım';
229 margin-left: -0.15em;
230 padding-left: 1.67ch;
231 background: url(icon128.png) no-repeat;
232 background-size: contain;
233 }
234
235 #VimFxHelpDialogContainer .logo::after {
236 content: 'Fx';
237 color: #d37826;
238 }
239
240 #VimFxHelpDialogContainer .title {
241 display: inline-block;
242 font-size: 1.4ex;
243 line-height: 1.2;
244 }
245
246 #VimFxHelpDialogContainer .close-button {
247 position: absolute;
248 right: 0;
249 top: 0;
250 font-size: 3em;
251 -moz-user-select: none;
252 }
253
254 #VimFxHelpDialogContainer .close-button:hover {
255 cursor: pointer;
256 }
257
258 #VimFxHelpDialogContainer .content {
259 display: flex;
260 flex-wrap: wrap;
261 }
262
263 #VimFxHelpDialogContainer .category {
264 flex: 1 16em;
265 margin-left: var(--gutter);
266 margin-bottom: calc(var(--page-padding) / 2);
267 }
268
269 #VimFxHelpDialogContainer :-moz-any([data-mode="find"], [data-mode="marks"]) {
270 display: none;
271 }
272
273 #VimFxHelpDialogContainer .heading-mode,
274 #VimFxHelpDialogContainer .category:not(.first)::before {
275 font-size: 2em;
276 }
277
278 #VimFxHelpDialogContainer .category:not(.first)::before {
279 /* Insert newline the same size as a `.heading-mode` to vertically align all
280 * `.heading-category`s. */
281 content: "\A";
282 white-space: pre;
283 }
284
285 #VimFxHelpDialogContainer .heading-category {
286 font-size: 1.5em;
287 }
288
289 #VimFxHelpDialogContainer .command {
290 float: left;
291 clear: left;
292 width: 100%;
293 margin-top: 0.2em;
294 }
295
296 #VimFxHelpDialogContainer .command.has-click {
297 cursor: pointer;
298 }
299
300 #VimFxHelpDialogContainer .command.has-click:hover * {
301 text-decoration: underline;
302 }
303
304 #VimFxHelpDialogContainer .key-sequence {
305 float: left;
306 margin-right: 1.7ch;
307 }
308
309 #VimFxHelpDialogContainer .key-sequence:last-of-type {
310 margin-right: 0.7ch;
311 }
312
313 #VimFxHelpDialogContainer .key-sequence-special-keys {
314 /* The special keys are not helpful in the help dialog. If somebody
315 * disagrees, they can simply re-show them with custom CSS. */
316 display: none;
317 }
318
319 #VimFxHelpDialogContainer .key-sequence-rest {
320 display: inline;
321 }
322
323 #VimFxHelpDialogContainer .description {
324 float: right;
325 width: calc(100% - 3.7em);
326 }
327
328 #VimFxHelpDialogContainer .search-input {
329 position: absolute;
330 right: 0;
331 bottom: 0;
332 }
333
334 #VimFxHelpDialogContainer .search-input:not([focused="true"]) {
335 opacity: 0;
336 pointer-events: none;
337 }
338
339 #VimFxHelpDialogContainer .search-match {} /* Keep as documentation. */
340
341 #VimFxHelpDialogContainer .search-non-match {
342 opacity: 0.2;
343 }
344
345 #VimFxHelpDialogContainer .search-highlight {
346 display: inline;
347 background-color: Highlight;
348 color: HighlightText;
349 }
350
351 }
Imprint / Impressum