GridField.scss
16.4 KB
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
/**
* Core styles for the basic GridField form field without any specific style.
*
* @package framework
* @subpackage scss
* @todo Add radial gradient to default delete button state
* @todo Create SASS mixin-function to simply swap the from/to, to to/from colours in grsdient mixins?
*/
@import "compass/css3";
@import "compass/css3/images";
@import "compass/css3/text-shadow";
@import "compass/css3/border-radius";
@import "../admin/scss/themes/default";
@import "../admin/scss/_mixins";
@import "_elementMixins";
//$experimental-support-for-svg variable comes from
//imported compass/support file and enables svg gradients in IE9.
//This is needed for the background gradients to work as desired with
//multiple images.
$experimental-support-for-svg: true;
$gf_colour_gradient_dark: darken($color-base, 8%);
$gf_colour_header_border: $gf_colour_gradient_dark;
$gf_colour_subheader: saturate(lighten($color-base, 15%),5%);
$gf_colour_border: rgba(0,0,0,.1);
$gf_colour_zebra: #F0F4F7;
$gf_colour_font: #666;
$gf_colour_text_shadow: rgba(0,0,0,.2);
$gf_colour_text_shadow_dark: rgba(0,0,0,.4);
$gf_border_radius: 5px;
$gf_grid_y: 12px;
$gf_grid_x: 16px;
.cms {
.ss-gridfield {
& > div {
margin-bottom: $gf_grid_y*3;
&.addNewGridFieldButton{
margin-bottom: 0;
.action {
margin-bottom:$gf_grid_y;
}
}
&.ss-gridfield-buttonrow-before{
margin-bottom: 0;
.action {
margin-bottom:$gf_grid_y;
}
}
&.ss-gridfield-buttonrow-after{
margin-bottom: 0;
.action {
margin-top:$gf_grid_y;
}
}
}
&[data-selectable] {
tr.ui-selected, tr.ui-selecting {
background: #FFFAD6 !important;
}
td {
cursor: pointer;
}
}
span button#action_gridfield_relationfind {
display:none; //hides find button - redundant functionality
}
p button#action_export {
span.btn-icon-download-csv {
height:17px; //exact height of icon
}
}
.right {
float:right;
& > * {
float: right;
margin-left:$gf_grid_x/2;
}
.pagination-records-number {
font-size: 1.0em;
padding: 6px 3px 6px 0;
color: $color-text-light;
@include single-text-shadow($gf_colour_text_shadow, 0px, -1px, 0);
font-weight: normal;
}
}
.left {
float:left;
& > * {
margin-right:$gf_grid_x/2;
float: left;
font-size: $gf_grid_y*1.2;
}
}
.ss-gridfield-buttonrow {
font-size: $gf_grid_y*1.2;
}
}
.ss-gridfield {
.grid-levelup {
text-indent: -9999em;
a.list-parent-link{
background: transparent url(../images/gridfield-level-up.png) no-repeat 0 0;
display:block;
}
margin-bottom: 6px;
}
.add-existing-autocompleter {
span {
float: left;
@include inline-block(top);
}
input.relation-search {
width: 270px; height: 32px;
margin-bottom: $gf_grid_y;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
button#action_gridfield_relationadd {
height: 32px;
margin-left: 0; // Webkit needs this
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none;
}
}
.grid-csv-button, .grid-print-button {
margin-bottom: 0;
font-size: $font-base-size;
@include inline-block();
}
}
table.ss-gridfield-table {
display: table;
@include box-shadow-none;
padding: 0;
border-collapse: separate;
border-bottom: 0 none;
width: 100%;
thead {
color: darken($color-base, 50%);
background: transparent;
tr.filter-header {
.fieldgroup {
max-width:$gf_grid_x*32; //max width 512px
.fieldgroup-field {
padding:0;
}
}
}
tr:first-child { //sets 7px border-radius on the top row in the thead - accounts for edgecase where there is no title row.
th:first-child {
@include border-top-left-radius($gf_border_radius);
}
th:last-child {
@include border-top-right-radius($gf_border_radius);
}
}
}
tbody {
background: #FFF;
tr {
// This lets iOS Safari know that these elements are clickable
// and so to send the click events.
cursor: pointer;
}
td {
width: auto;
max-width: 500px; //This number is semi-arbitary. It is acting as a percentage limit, rather than actually constricting the width to 500px.
word-wrap:break-word;
// Give browser some hints on which cols take priority:
// The last column (buttons) should always shrink to fit.
// Overwritten for IE7, which doesnt support this.
&.col-buttons {
width: 1px;
padding:0 $gf_grid_x/2;
text-align: right;
white-space: nowrap;
}
&.col-listChildrenLink {
width:$gf_grid_x;
border-right:none;
text-indent:-9999em;
padding:0;
.list-children-link {
background: transparent url(../images/sitetree_ss_default_icons.png) no-repeat 3px -4px;
display:block;
}
}
&.col-getTreeTitle {
span.item {
color:$color-text-blue-link;
}
span.badge {
clear: both;
text-transform: uppercase;
display: inline-block;
padding: 0px 3px;
font-size: 0.75em;
line-height: 1em;
margin-left: 10px;
margin-right: 6px;
margin-top: -1px;
@include border-radius(2px, 2px);
}
span.badge.status-modified {
color: #7E7470;
border: 1px solid #C9B800;
background-color: #FFF0BC;
}
span.badge.status-addedtodraft {
color: #7E7470;
border: 1px solid #C9B800;
background-color: #FFF0BC;
}
span.badge.status-deletedonlive {
color: #636363;
border: 1px solid #E49393;
background-color: #F2DADB;
}
span.badge.status-removedfromdraft {
color: #636363;
border: 1px solid #E49393;
background-color: #F2DADB;
}
span.badge.status-workflow-approval {
color: #56660C;
border: 1px solid #7C8816;
background-color: #DAE79A;
}
}
button {
border: none;
background: none;
margin: 0 0 0 2px;
padding: 1px 0;
width: auto;
text-shadow: none;
&.ui-state-hover {
background:none;
@include box-shadow-none;
}
&.ui-state-active {
border:none;
@include box-shadow-none;
}
&.gridfield-button-delete {
width: 20px;
margin: 0;
span.btn-icon-decline {
left: 2px;
}
}
}
a.view-link, a.edit-link {
display:inline-block;
width:20px;
height:20px; //min height to fit the edit icon
text-indent:9999em;
overflow: hidden;
vertical-align: middle;
}
a.view-link {
background: url(../admin/images/btn-icon/magnifier.png) no-repeat 0 1px;
}
a.edit-link {
background: url(../admin/images/btn-icon/document--pencil.png) no-repeat 2px 0px;
}
}
}
tfoot {
color: darken($color-base, 50%);
tr {
td {
background: $color-base;
padding: .7em;
border-bottom: 1px solid rgba(0,0,0,.1);
}
}
}
tr {
&.title {
th {
position: relative;
background: $gf_colour_gradient_dark;
border-bottom: 1px solid darken($gf_colour_gradient_dark,5%);
padding: 5px;
min-height: 40px; //this is to accomodate the add new button.
@include background-image(linear-gradient($color-base, $gf_colour_gradient_dark));
@include single-text-shadow($gf_colour_text_shadow_dark, 0px, -1px, 0);
h2{
padding: 0px;
font-size: $gf_grid_y*1.4;
color:#fff;
margin: 1px 8px 0;
display:inline-block;
float:left;
}
}
}
&.sortable-header {
background: $gf_colour_subheader;
th{
padding: 0; // Should be padding: 0 1em; like td
font-weight: normal;
.ss-ui-button {
font-weight: normal;
}
}
}
&:hover {
background: #FFFAD6;
}
&:first-child {
background: transparent;
&:hover {
background: #FFFAD6;
}
}
&.ss-gridfield-even {
background: $gf_colour_zebra;
&.ss-gridfield-last {
border-bottom: none;
}
&:hover {
background: #FFFAD6;
}
}
&.even {
background: $gf_colour_zebra;
&:hover {
background: #FFFAD6;
}
}
th {
font-weight: bold;
font-size: $gf_grid_y;
color: #FFF;
padding: 5px;
border-right: 1px solid $gf_colour_border;
div {
&.fieldgroup,&.fieldgroup-field {
width: 100%;
position:relative;
}
&.fieldgroup {
min-width: $gf_grid_x*12.5;
padding-right:0;
&.filter-buttons{
min-width:49px;
box-shadow: none;
border: none;
div{
width:auto;
display:inline;
}
}
}
}
&.main{
white-space:nowrap;
border-top: 1px solid darken($color-base,4%);
border-left: 1px solid darken($color-base,4%);
color:#fff;
background: $gf_colour_gradient_dark;
border-bottom: 1px solid $gf_colour_border;
span{
@include single-text-shadow($gf_colour_text_shadow, 0px, -1px, 0);
padding-left: $gf_grid_x/2;
padding-right: $gf_grid_x/2;
@include hide-text-overflow; // Add ellipses to overflowing text
margin-right: 8px;
}
&.col-listChildrenLink {
border-right:none;
}
}
&.extra,&.action {
padding: 0;
cursor: default;
}
&.extra {
position:relative;
background:darken($color-dark-grey, 10%);
background: rgba(#000, 0.7);
padding: 5px;
border-top: $gf_colour_text_shadow;
input {
height:28px; //height of input field - to match design.
}
button.ss-ui-button {
padding: .3em;
line-height: 1;
@include box-shadow-none;
position: relative;
border-bottom-width: 0;
@include border-radius(2px, 2px);
}
select {
margin: 0;
}
}
&.first {
@include border-top-left-radius($gf_border_radius);
}
&.last {
@include border-top-right-radius($gf_border_radius);
}
button {
&#action_gridfield_relationadd:hover {
color: #444 !important; /* Not sure why IE think it needs this */
}
&:hover {
color: #ccc !important; /* Not sure why IE think it needs this */
}
&.ss-gridfield-sort:hover {
color: #fff !important;
@include box-shadow-none;
}
&.ss-gridfield-sort {
background: transparent url(../images/arrows.png) no-repeat right 6px;
border:none;
width:100%;
text-align: left;
padding: 2px 8px 2px 0; // Doesn't need to be so big now that filter has moved
@include single-text-shadow($gf_colour_text_shadow, 0px, -1px, 0);
color: #fff;
@include border-radius(0);
&:hover {
background-position: right -34px;
}
&.ss-gridfield-sorted-desc {
background-position: right -72px;
}
&.ss-gridfield-sorted-asc {
background-position: right -116px;
}
}
&.ss-ui-button{
&.ss-gridfield-button-filter{
$bgImage: url(../images/icons/filter-icons.png) no-repeat;
background-color:lighten($color-menu-button,10%);
@include gridFieldButtons;
@include background(
$bgImage -15px 4px,
linear-gradient(
$color-menu-button,
darken($color-menu-button, 10%)
)
);
width: 26px;
border-top: 1px solid lighten($color-menu-button, 5%);
&.hover-alike:active, &:active, &.hover-alike, &:hover {
@include background (
$bgImage -15px 4px,
linear-gradient(
lighten($color-menu-button, 10%),
$color-menu-button
));
}
&.trigger{ //The magnifying glass before filter is opened
margin-left: $gf_grid_y;
border:none;
@include background ($bgImage -17px 6px);
padding-right: 46px;
margin: 0 $gf_grid_y/2;
span{ //this is the dropdown arrow
opacity: 0.4;
position:absolute;
width:10px;
left:30px;
top:40%;
background: url(../admin/images/btn_arrow_down_grey.png) no-repeat 0px 0px;
}
&:hover{
@include background ($bgImage -17px -38px);
@include box-shadow-none;
span{//dropdown arrow
opacity:0.9;
}
}
}
}
&.ss-gridfield-button-close{
$bgImage: url(../images/icons/filter-icons.png) no-repeat;
@include background ($bgImage 8px -17px);
@include gridFieldButtons;
width:25px;
opacity:0.8;
margin-right:-5px; //For IE
&.hover-alike:active, &:active, &.hover-alike, &:hover {
opacity:1;
@include background (
$bgImage 8px -17px,
linear-gradient(
rgba(#fff,0.1),
rgba(#fff,0.1)
)
);
}
}
&.ss-gridfield-button-reset{
@include gridFieldButtons;
position:absolute;
top: -21px;
right: -1px;
width:20px;
height:20px;
display:none;
&.filtered{
display:block;
background: url(../admin/images/btn-icon/cross.png) no-repeat 0px 0px;
opacity:0.5;
&:hover{
opacity:0.8;
}
&:active {
opacity:1;
}
}
}
}
}
input {
&.ss-gridfield-sort {
height:25px;
padding: 4px;
// Placeholder styling done with an each loop because when a browser
// doesn’t understand a selector, it invalidates the entire line of selectors.
// This avoids that, and keeps the scss tidy
$browserPlaceholder: "::-webkit-input-placeholder", ":-moz-placeholder", ":-ms-input-placeholder", ":placeholder";
border: 1px solid #313232;
@each $browser in $browserPlaceholder {
&#{$browser}{
font-style:italic;
color: lighten($color-dark-grey,30%);
}
}
&:focus {
@include box-shadow-none;
}
}
}
span.non-sortable {
display:block;
padding: 6px 8px;
}
}
td {
border-right: 1px solid $gf_colour_border;
padding: $gf_grid_x/2 $gf_grid_x/2;
color: $gf_colour_font;
&.bottom-all {
@include border-bottom-radius($gf_border_radius);
@include background-image(linear-gradient($color-base, $gf_colour_gradient_dark));
padding: $gf_grid_x/4 $gf_grid_y;
.datagrid-footer-message {
text-align: center;
padding-top: 6px;
color:$color-text-light;
}
.datagrid-pagination {
padding-top:1px;
position:absolute;
left:50%;
margin-left:-116px; //half the width of .datagrid-pagination - centers pagination
.pagination-page-number {
color:$color-text-light;
text-align: center;
@include single-text-shadow($gf_colour_text_shadow, 0px, -1px, 0);
input {
width:35px; //exact width so that a four digit number can be entered
height:18px;
margin-bottom:-6px; //moves input field up to be aligned with the pagination buttons
padding:0px;
border: 1px solid darken($gf_colour_gradient_dark, 5%);
border-bottom: 1px solid lighten($gf_colour_gradient_dark, 5%);
}
}
z-index:5;
button{
@include box-shadow-none;
border:none;
width:10px;
margin:0 10px;
display:inline;
float:none;
span {
text-indent:-9999em;
}
&.ss-gridfield-previouspage {
@include background (url(../images/icons/pagination-arrows.png) no-repeat -23px 8px);
}
&.ss-gridfield-nextpage {
@include background (url(../images/icons/pagination-arrows.png) no-repeat -47px 8px);
}
&.ss-gridfield-firstpage {
@include background (url(../images/icons/pagination-arrows.png) no-repeat 0px 8px);
}
&.ss-gridfield-lastpage {
@include background (url(../images/icons/pagination-arrows.png) no-repeat -73px 8px);
}
&.ssui-button-disabled{
z-index:-1;
}
}
}
.pagination-records-number {
float:right;
padding:6px 0;
color:$color-text-light;
@include single-text-shadow($gf_colour_text_shadow, 0px, -1px, 0);
}
}
}
&.last td {
border-bottom: 0 none;
}
}
td:first-child{
border-left: 1px solid $gf_colour_border;
}
td:last-child{
border-right: 1px solid $gf_colour_border;
}
}
}