-
Notifications
You must be signed in to change notification settings - Fork 0
/
brackets.less
826 lines (690 loc) · 19.6 KB
/
brackets.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
/*
* This file first imports all of the shared LESS/CSS, and then defines
* version-specific layout (e.g. layout for the App shell, or layout for
* the In-Browser version on Firefox).
*
* Going forward, we may have different versions of this file for different
* Versions (e.g. App, In-Browser, etc.)
*
* Anything that is general/reusable should be pushed up into a LESS file
* in the "styles" directory. See "brackets_shared.less" for the organization
*
* Date: @DATE
*/
/* IMPORTANT: importing brackets_shared should be the first step in this file
* This is so that imported CSS files (NOT LESS files) end up in the
* right place
*/
@import "brackets_shared.less";
/* Overall layout */
html, body {
height: 100%;
overflow: hidden;
/* Turn off selection for UI elements */
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
/* And make sure we get a pointer cursor even over text */
cursor: default;
/* Turn off subpixel antialiasing on Mac since it flickers during animations. */
-webkit-font-smoothing: subpixel-antialiased;
}
body {
height: 100%;
}
.resizing-container {
position: absolute;
top: 0;
width: 100%;
height: 100%;
z-index: @z-index-brackets-panel-resizer;
&.horz-resizing {
cursor: col-resize;
}
&.vert-resizing {
cursor: row-resize;
}
}
a, img {
-webkit-user-drag: none;
}
.main-view {
height: 100%;
.sidebar {
height: 100%;
.vbox;
width: @sidebar-width; // changed dynamically via Resizer
position: absolute;
left: 0;
top: 0;
}
.content {
height: 100%;
position: absolute;
padding: 0;
top: 0;
left: @sidebar-width; // changed dynamically via Resizer
right: @main-toolbar-width;
}
}
#titlebar, .modal-bar {
.box-shadow(0 1px 1px 0 fadeout(@bc-black, 90%));
// Make sure the bottom box-shadow goes above the editor (position: relative needed to start a new stacking group)
position: relative;
z-index: @z-index-brackets-toolbar;
}
.busyCursor {
cursor: wait !important;
}
#status-bar {
position: relative;
background-color: @background-color-3;
border-top: 1px solid darken(@background-color-3, @bc-color-step-size / 2);
box-sizing: border-box;
color: @bc-grey;
font-family: @fontstack-sans-serif;
font-size: 0.9em;
line-height: 1;
height: 20px;
overflow: hidden;
padding: 3px 20px 3px 10px;
}
#status-info {
position: absolute;
left: 8px;
background-color: @background-color-3;
white-space: nowrap;
div {
display: inline;
margin-right: 20px;
}
}
#status-indicators {
position: absolute;
right: 4px;
background-color: @background-color-3;
white-space: nowrap;
&>div {
display: inline-block;
margin-left: 20px;
}
&>.spinner { // spinner is tiny & usually invisible; reduce margin so gap is less glaring
margin-left: 5px;
}
}
@-webkit-keyframes rotating {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
#status-indent > * {
display: inline-block;
}
#status-indent > *.hidden {
display: none;
}
#indent-type, #indent-width-label {
margin-right: 2px;
}
#indent-width-label {
width: 14px;
}
#indent-type:hover, #indent-width-label:hover {
text-decoration: underline;
}
#indent-width-input {
font-size: 1em;
height: 12px;
line-height: 1;
vertical-align: -2px;
border: 1px solid darken(@background-color-3, @bc-color-step-size / 2);
color: @bc-black;
margin: 0;
padding: 0;
width: 14px;
position: relative;
left: -1px;
top: -2px;
-webkit-border-radius: 2px;
border-radius: 2px;
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
}
#indent-width-input:focus {
border: 1px solid rgba(9,64,253,0.84);
outline: none;
}
#indent-width-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
#editor-holder {
position: relative;
/* Placeholder shown when there is no editor open */
#not-editor {
height: 100%;
.vbox;
.box-pack(center);
.box-align(center);
background: @background-color-2 url('images/no_content_bg.svg') no-repeat center 45%;
}
}
.vert-resizer {
position: absolute;
height: 6px;
width: 100%;
z-index: @z-index-brackets-panel-resizer;
opacity: 0;
cursor: row-resize;
}
.horz-resizer {
position: absolute;
height: 100%;
width: 6px;
z-index: @z-index-brackets-panel-resizer;
opacity: 0;
cursor: col-resize;
}
.bottom-panel {
display: none;
height: 200px;
border-top-style: solid;
border-width: 1px;
border-color: lighten(@bc-grey, @bc-color-step-size*4);
.toolbar {
height: auto;
padding-top: @base-padding / 2;
padding-bottom: @base-padding / 2;
z-index: @z-index-brackets-results-panel;
.box-shadow(0 -1px 3px 0 fadeout(@bc-black, 70%));
.title {
font-size: @label-font-size;
font-weight: bold;
}
.close {
position: absolute;
right: 10px;
}
}
.table-container {
height: 170px;
overflow: auto;
td {
padding-left: @base-padding;
padding-right: @base-padding;
}
.highlight {
background: #d2dcf8;
}
tr.selected td {
background-color: @bc-light-blue;
}
}
}
#update-notification {
margin-bottom: -1px;
.sprite-icon(0,0, 14px,14px, "images/updateSprites.svg");
&:hover {
.sprite-swap(0,14px);
}
display:none;
}
#toolbar-go-live {
// Default icon is for the 'disconnected' state
// The 'connecting failed' (.warning) state also maps here
.sprite-icon(0,0, 22px,16px, "images/live_development_sprites.svg");
&:hover {
.sprite-swap(0,16px);
}
// 'Connected' state
&.success {
.sprite-swap(0,32px);
}
&.success:hover {
.sprite-swap(0,48px);
}
// 'Connection in progress' state
&.info {
.sprite-swap(0,64px);
}
// 'Out-of-sync' state
&.out-of-sync {
.sprite-swap(0,80px);
}
&.out-of-sync:hover {
.sprite-swap(0,96px);
}
}
/* Project panel */
#project-header {
/* Fixed height blank space for now. The mockups have the window "stoplights" or a logo here. */
height: 29px;
}
#sidebar-resizer {
position: absolute;
width: 6px;
height: 100%;
z-index: @z-index-brackets-sidebar-resizer;
opacity: 0;
cursor: col-resize;
}
#file-section {
.vbox;
.box-flex(1);
margin: 5px 0px 0px 0px;
position: relative;
.project-file-header-area {
padding: 6px 6px 2px 10px;
font-size: 13px;
color: #929292;
}
.file-list-divider {
border-bottom: 1px solid #9a9a9a;
box-shadow: 0px 1px #eeeeee;
}
}
#open-files-container {
.box-flex(0);
margin: 0 0 22px 0;
padding: 0px;
max-height: 200px; // TODO (Issue #276): it would be nicer to have this be 50%, but that doesn't seem to work
ul {
list-style-type: none;
margin: 0;
}
li {
white-space: nowrap;
position: relative; // so that children can be positioned absolute
line-height: 18px;
padding: 0 0 0 8px;
min-height: 18px;
vertical-align: baseline;
}
a {
color: #BBB;
font-size: 13px;
text-decoration: none;
display: block;
height: 16px;
line-height: 16px;
margin-left: 18px;
padding: 3px (@triangle-size * 2) 3px 0;
cursor: default;
}
.selected a {
color: #fff;
}
}
.sidebar-selection {
background: url("images/active_back.png") no-repeat top right;
height: 22px;
position: absolute;
}
.sidebar-selection-triangle {
background: url("images/active_back.png");
width: 10px;
height: 22px;
position: fixed;
z-index: @z-index-brackets-selection-triangle; /* scroller-shadow appears above this triangle */
}
.sidebar-selection-triangle.triangle-visible:before {
content: "";
border-top: @triangle-size solid transparent;
border-bottom: @triangle-size solid transparent;
border-right: @triangle-size solid @background-color-3;
display: block;
position: absolute;
top: 2px;
right: 0;
width: 0;
height: 0;
.scale-x(0.9, right, top);
}
//Initially start with the open files hidden, they will get show as files are added
#open-files-container {
display:none;
}
#project-files-container {
.box-flex(1);
.jstree-brackets li > a {
padding-right: @triangle-size * 2;
}
ul {
padding-left: 8px;
}
}
#editor-holder .scroller-shadow {
width: 100%;
}
.scroller-shadow {
background-size: 100%;
background-repeat: no-repeat;
height: 5px;
position: fixed;
z-index: @z-index-brackets-scroller-shadow;
&.top {
#gradient.vertical(rgba(0,0,0,0.1), rgba(0,0,0,0));
background-position: 0 -5px;
}
&.bottom {
#gradient.vertical(rgba(0,0,0,0), rgba(0,0,0,0.1));
background-position: 0 5px;
background-color: transparent; /* override background-color: @endColor from #gradient.vertical */
}
}
@jstree-sprite-size: 18px; // this is hardcoded in jsTree's JS code
/** Classes for icons from jsTreeSprites.svg
*/
.jstree-sprite {
background-image: url("images/jsTreeSprites.svg");
background-repeat: no-repeat;
background-color: transparent;
vertical-align: middle;
width: @jstree-sprite-size;
height: @jstree-sprite-size;
}
/** Classes for icons from bracketSprites.png
*/
.bracket-sprite {
background-image: url("images/close_btn.svg");
background-repeat: no-repeat;
background-color: transparent;
vertical-align: middle;
width: 15px;
height: 16px;
}
.file-status-icon {
margin: 3px 0 0 8px;
.bracket-sprite;
display: inline-block;
position: absolute;
left: 0px;
top: 1px;
&.dirty {
background-position: -30px 0;
}
&.can-close {
background-position: 0 0;
}
&.can-close:hover {
background-position: -15px 0;
}
&.can-close:active {
background-position: -15px 1px;
}
}
/* Styles for inline editors */
.inline-widget {
background-color: @inline-background-color-1;
min-width: 250px;
cursor: default;
.CodeMirror {
/* remove CodeMirror default height: 300px */
height: auto;
}
.inline-editor-header {
padding: 10px 10px 0px 10px;
.filename {
font-family: @fontstack-sans-serif;
font-size: 1.1em;
color: @inline-color-1;
// Filename header is clickable (it's an <a> tag, so we get underscore on hover by
// default; but the hand cursor is shut off by Bootstrap's reset stylesheet)
cursor: pointer;
.dirty-indicator {
.bracket-sprite;
display: inline-block;
background-position: -32px 0;
padding-top: 3px;
}
.line-number {
color: @inline-color-2;
}
}
}
.shadow {
display: block;
height: 4px;
width: 100%;
position: absolute;
content: " ";
left: 0;
z-index: @z-index-brackets-inline-editor-shadow;
}
.shadow.top {
top: 0px;
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
}
.shadow.bottom {
bottom: 0px;
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1));
}
.CodeMirror-scroll {
background-color: transparent;
.CodeMirror-linenumbers {
background-color: @inline-background-color-1;
}
}
}
/* CSSInlineEditor rule list */
.related-container {
@top-margin: 12px;
float: right;
position: relative;
min-height: 100%;
font-family: @fontstack-sans-serif;
width: 250px;
max-width: 50%;
overflow: hidden;
background: @inline-background-color-2;
.selection {
width: 100%;
background: #d0d5d5;
position: absolute;
-webkit-transition: height 0.1s ease-out;
-webkit-transition: top 0.1s ease-out;
border-top: 1px solid darken(@inline-background-color-3, @bc-color-step-size);
border-bottom: 1px solid lighten(@inline-background-color-3, @bc-color-step-size);
top: @top-margin;
}
/*
* CSS triangle hack with anti-alias workarounds:
* (a) Use selection-background-color instead of transparent.
* (b) Use transform scaleX and origin to adjust width.
*/
.selection:before {
content: " ";
position: absolute;
width: 0;
height: 0;
border-top: @triangle-size solid @inline-background-color-3;
border-bottom: @triangle-size solid @inline-background-color-3;
border-left: @triangle-size solid @inline-background-color-1;
margin-top: -@triangle-size;
top: 50%;
.scale-x(0.9, left, top);
}
.related {
font-size: 12px;
position: absolute;
top: 0;
left: 1px;
width: 100%;
ul {
margin: 0;
padding: @top-margin 0px;
list-style: none;
}
li {
color: @inline-color-2;
margin: 0;
overflow: hidden;
padding: 2px 0px 2px 15px;
text-overflow: ellipsis;
white-space: nowrap;
}
.selected {
color: @inline-color-3;
-webkit-transition: color 0.1s ease-out .15s;
}
}
}
/* This text is used to force the code editor's font to be loaded early on if it's a
web font. This is necessary in order for the editor's horizontal measurement of text
to work properly.
In the future, when we allow the user to switch fonts, we'll need to make sure to
update the font for this text item whenever the user switches. We'll also need to
wait to initiate a re-measure in CodeMirror until the new font is loaded (if they
choose a web font). This library allows for checking if a web font is loaded:
http://code.google.com/apis/webfonts/docs/webfont_loader.html
*/
.dummy-text {
position: fixed;
top: -10000px;
.code-font();
}
.platform-mac .dummy-text {
.code-font-mac();
}
/* Find in Files results panel - temporary UI, to be replaced with a richer search feature later */
#search-results .disclosure-triangle {
.jstree-sprite;
display: inline-block;
&.expanded {
// Unfortunately, the way jsTree sprites are aligned within their 18px boxes doesn't look good in
// other contexts, so we need some tweaks here instead of straight multiples of @jstree-sprite-size
background-position: -(@jstree-sprite-size*1 - 2px) -(@jstree-sprite-size*1 - 1px);
}
&.collapsed {
background-position: -(@jstree-sprite-size*0 - 2px) -@jstree-sprite-size*1;
}
}
#search-results td {
vertical-align: baseline;
}
/* Modal bar for Find/Quick Open */
.modal-bar {
text-align: left;
font-family: @fontstack-sans-serif;
font-size: 13px;
color: @content-color;
background: #eee;
padding: 5px 4px 4px 14px;
overflow: hidden;
body.in-browser & {
// Separator line between us and the HTML menu/titlebar above
border-top: 1px solid darken(@background-color-3, @bc-color-step-size);
}
}
.modal-bar input {
font-family: @fontstack-sans-serif;
border: 1px solid @content-color-weaker;
outline: none;
background: @background-color-3;
width: 20em;
margin: .3em .3em;
color: inherit;
&.no-results {
background-color: mix(@background-color-3, #FF0000, 70%);
}
}
.modal-bar .message {
display: inline-block;
}
.modal-bar .error {
display: none;
.alert-message {
padding-top: 4px;
padding-bottom: 4px;
}
}
// Search result highlighting - CodeMirror highlighting is pretty constrained. Highlights are
// blended on TOP of the selection color. The "current" search result is indicated by selection,
// so we want the selection visible underneath the highlight. To do this, the highlight must be
// transparent; it has to look good atop both the selection color AND the regular text bg color.
.CodeMirror-searching {
// Highlight color, overlaid on top of the .find-highlighting color
background-color: rgba(244, 237, 98, 0.7);
}
.CodeMirror.find-highlighting div.CodeMirror-selected,
.CodeMirror .CodeMirror.find-highlighting div.CodeMirror-selected {
// Selection color while highlighting shown - ALWAYS has the .CodeMirror-searching color
// blended atop it.
// Note: the 2nd selector reflecting CM nesting is needed to override the similar rules in
// brackets_codemirror_override.less (see the note about #324).
background: rgb(255, 108, 0);
}
#find-counter {
font-weight: bold;
}
/* Quick Open search bar & dropdown */
.smart_autocomplete_container {
border: 1px solid #999;
background-color: #FFFFFF;
/* smart auto complete doesn't correctly position the container
* so these specific padding and margin values are necessary*/
padding: 0px 8px 0px 0px;
margin: 9px 0px 0px 0px;
.quick-open-path {
font-size: 11px;
color: gray;
}
li {
color: black;
border-bottom: 1px solid;
list-style: none;
cursor: default;
padding: 0px 2px 0px 4px;
}
}
li.smart_autocomplete_highlight {
background-color: #e0f0fa;
}
.quicksearch-pathmatch {
font-weight: bold;
color: #555;
}
.quicksearch-namematch {
font-weight: bold;
}
/* Spinner */
.spinner {
display: inline-block;
vertical-align: middle;
margin-top: -2px;
width: 12px;
height: 12px;
background: url("images/small_spinner.svg") no-repeat;
visibility: hidden;
&.spin {
-webkit-animation: rotating 1.5s linear infinite;
visibility: visible;
}
}