summaryrefslogtreecommitdiffstats
path: root/jquery/sass/_sm-dox.scss
blob: e1db779ca4461175d833548f66fc32b86d839311 (plain)
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
@import 'compass';

// This file is best viewed with Tab size 4 code indentation


// -----------------------------------------------------------------------------------------------------------------
// 1. Theme Quick Settings (Variables)
// (for further control, you will need to dig into the actual CSS in 2.)
// -----------------------------------------------------------------------------------------------------------------


// ----------------------------------------------------------
// :: 1.1. Colors
// ----------------------------------------------------------

$sm-dox__white:                                       #fff !default;
$sm-dox__gray:                                        darken($sm-dox__white, 6.5%) !default;
$sm-dox__gray-dark:                                   darken($sm-dox__white, 26.5%) !default;
$sm-dox__gray-darker:                                 darken($sm-dox__white, 66.5%) !default;
$sm-dox__red:                                         #D23600 !default;

$sm-dox__box-shadow:                                  rgba(0, 0, 0, 0.2) !default;


// ----------------------------------------------------------
// :: 1.2. Breakpoints
// ----------------------------------------------------------

$sm-dox__desktop-vp:                                  768px !default;     // switch from collapsible to desktop


// ----------------------------------------------------------
// :: 1.3. Typography
// ----------------------------------------------------------

$sm-dox__font-family:                                 "Lucida Grande", "Geneva", "Helvetica", Arial, sans-serif !default;
$sm-dox__font-size-base:                              13px !default;
$sm-dox__font-size-small:                             12px !default;
$sm-dox__line-height:                                 15px !default;


// ----------------------------------------------------------
// :: 1.4. Borders
// ----------------------------------------------------------

$sm-dox__border-width:                                1px !default;
$sm-dox__border-radius:                               5px !default;


// ----------------------------------------------------------
// :: 1.5. Collapsible main menu
// ----------------------------------------------------------

// Menu box
//$sm-dox__collapsible-bg:                              $sm-dox__gray !default;
$sm-dox__collapsible-bg:                              url('tab_b.png') !default;
$sm-dox__collapsible-border-radius:                   $sm-dox__border-radius !default;

// Items
$sm-dox__collapsible-item-color:                      $sm-dox__gray-darker !default;
$sm-dox__collapsible-item-current-color:              $sm-dox__red !default;
$sm-dox__collapsible-item-disabled-color:             darken($sm-dox__gray, 20%) !default;
$sm-dox__collapsible-item-padding-vertical:               0px !default;
$sm-dox__collapsible-item-padding-horizontal:             12px !default;

// Items separators
$sm-dox__collapsible-separators-color:                rgba(0, 0, 0, 0.05) !default;

// Toggle button (sub menu indicators)
$sm-dox__collapsible-toggle-bg:                       rgba(255, 255, 255, 0.5) !default;


// ----------------------------------------------------------
// :: 1.6. Collapsible sub menus
// ----------------------------------------------------------

// Menu box
$sm-dox__collapsible-sub-bg:                          rgba(darken($sm-dox__gray, 30%), 0.1) !default;

// Items text indentation for deeper levels
$sm-dox__collapsible-sub-item-indentation:            8px !default;


// ----------------------------------------------------------
// :: 1.7. Desktop main menu
// ----------------------------------------------------------

// Menu box
//$sm-dox__desktop-bg:                                  $sm-dox__gray !default;
$sm-dox__desktop-bg:                                  url('tab_b.png') !default;
//$sm-dox__desktop-border-radius:                       100px !default;
$sm-dox__desktop-padding-horizontal:                  10px !default;

// Items
$sm-dox__desktop-item-color:                          $sm-dox__gray_darker !default;
$sm-dox__desktop-item-hover-color:                    $sm-dox__red !default;
$sm-dox__desktop-item-current-color:                  $sm-dox__red !default;
$sm-dox__desktop-item-disabled-color:                 darken($sm-dox__gray, 20%) !default;
$sm-dox__desktop-item-padding-vertical:               0px !default;
$sm-dox__desktop-item-padding-horizontal:             12px !default;

// Sub menu indicators
$sm-dox__desktop-arrow-size:                          4px !default;       // border-width
$sm-dox__desktop-arrow-color:                         $sm-dox__gray-darker !default;
$sm-dox__desktop-arrow-spacing:                       4px !default;

// Vertical menu box
$sm-dox__desktop-vertical-border-radius:              $sm-dox__border-radius !default;
$sm-dox__desktop-vertical-padding-vertical:           10px !default;

// Vertical items
$sm-dox__desktop-vertical-item-hover-bg:              $sm-dox__white !default;
$sm-dox__desktop-vertical-item-padding-vertical:      10px !default;
$sm-dox__desktop-vertical-item-padding-horizontal:    20px !default;

$sm-dox__main-text-color:                             #283A5D !default;
$sm-dox__main-highlight-color:                        white !default;

// ----------------------------------------------------------
// :: 1.8. Desktop sub menus
// ----------------------------------------------------------

// Menu box
$sm-dox__desktop-sub-bg:                              $sm-dox__white !default;
$sm-dox__desktop-sub-border-color:                    $sm-dox__gray-dark !default;
$sm-dox__desktop-sub-border-radius:                   $sm-dox__border-radius !default;
$sm-dox__desktop-sub-box-shadow:                      0 5px 9px $sm-dox__box-shadow !default;
$sm-dox__desktop-sub-padding-vertical:                5px !default;
$sm-dox__desktop-sub-padding-horizontal:              0 !default;

// Items
$sm-dox__desktop-sub-item-color:                      $sm-dox__gray_darker !default;
$sm-dox__desktop-sub-item-hover-color:                $sm-dox__red !default;
$sm-dox__desktop-sub-item-hover-bg:                   $sm-dox__gray !default;
$sm-dox__desktop-sub-item-current-color:              $sm-dox__red !default;
$sm-dox__desktop-sub-item-disabled-color:             darken($sm-dox__white, 20%) !default;
$sm-dox__desktop-sub-item-padding-vertical:           10px !default;
$sm-dox__desktop-sub-item-padding-horizontal:         20px !default;

// Sub menu indicators
$sm-dox__desktop-sub-arrow-size:                      5px !default;       // border-width

// Sub menu carets
$sm-dox__desktop-sub-caret-size:                      8px !default;       // border-width
$sm-dox__desktop-sub-caret-left:                      30px !default;

$sm-dox__main-row-height: 36px !default;

// -----------------------------------------------------------------------------------------------------------------
// 2. Theme CSS
// -----------------------------------------------------------------------------------------------------------------


// ----------------------------------------------------------
// :: 2.1. Collapsible mode (mobile first)
// ----------------------------------------------------------

// calc item height and sub menus toggle button size
$sm-dox__item-height: $sm-dox__line-height + $sm-dox__collapsible-item-padding-vertical * 2;
// set toggle button size to 80% of item height
$sm-dox__toggle-size: floor($sm-dox__main-row-height * 0.8);
$sm-dox__toggle-spacing: floor($sm-dox__main-row-height * 0.1);

// Main menu box
.sm-dox {
    background-image: $sm-dox__collapsible-bg;
    //@include border-radius($sm-dox__collapsible-border-radius);

    // Main menu items
    a {
        &,
        &:focus,
        &:hover,
        &:active {
            padding: $sm-dox__collapsible-item-padding-vertical $sm-dox__collapsible-item-padding-horizontal;
            /* make room for the toggle button (sub indicator) */
            padding-right: $sm-dox__collapsible-item-padding-horizontal + $sm-dox__toggle-size + $sm-dox__toggle-spacing;
            /* color: $sm-dox__collapsible-item-color; */
            font-family: $sm-dox__font-family;
            font-size: $sm-dox__font-size-base;
            font-weight: bold;
            line-height: 36px; //$sm-dox__line-height;
            text-decoration: none;
            text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
            color: $sm-dox__main-text-color;
            outline: none;
        }

        &:hover {
            background-image: url('tab_a.png');
            background-repeat:repeat-x;
            color: $sm-dox__main-highlight-color;
            text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
        }

        &.current {
            color: $sm-dox__collapsible-item-current-color;
        }

        &.disabled {
            color: $sm-dox__collapsible-item-disabled-color;
        }

        // Toggle buttons (sub menu indicators)
        span.sub-arrow {
            position: absolute;
            top: 50%;
            margin-top: -(ceil($sm-dox__toggle-size / 2));
            left: auto;
            right: $sm-dox__toggle-spacing;
            width: $sm-dox__toggle-size;
            height: $sm-dox__toggle-size;
            overflow: hidden;
            font: bold #{$sm-dox__font-size-small}/#{$sm-dox__toggle-size} monospace !important;
            text-align: center;
            text-shadow: none;
            background: $sm-dox__collapsible-toggle-bg;
            @include border-radius($sm-dox__border-radius);
        }
        & span.sub-arrow:before {
            display: block;
            content: '+';
        }
        // Change + to - on sub menu expand
        &.highlighted span.sub-arrow:before {
            display: block;
            content: '-';
        }
    }

    // round the corners of the first item
    > li:first-child > a, > li:first-child > :not(ul) a {
        @include border-radius($sm-dox__collapsible-border-radius $sm-dox__collapsible-border-radius 0 0);
    }
    // round the corners of the last item
    @include sm-dox__round-corners-last-item($sm-dox__collapsible-border-radius);

    // Main menu items separators
    //li {
    //    /*border-top: 1px solid $sm-dox__collapsible-separators-color;*/
    //	border-top: 0;
    //}
    //> li:first-child {
    //    border-top: 0;
    //}

    // Sub menus box
    ul {
        background: $sm-dox__collapsible-sub-bg;

        // Sub menus items
        a {
            &,
            &:focus,
            &:hover,
            &:active {
                font-size: $sm-dox__font-size-small;
                // add indentation for sub menus text
                border-left: $sm-dox__collapsible-sub-item-indentation solid transparent;
                //line-height: $sm-dox__line-height;
                line-height: $sm-dox__main-row-height;
                text-shadow: none;
	        background-color: white;
		background-image: none;
            }

            &:hover {
        //        color: $sm-dox__collapsible-item-current-color;
	//	background-color: $sm-dox__gray;
            background-image: url('tab_a.png');
            background-repeat:repeat-x;
            color: $sm-dox__main-highlight-color;
            text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
            }

        }

        // Add indentation for sub menus text for deeper levels
        @include sm-dox__sub-items-indentation($sm-dox__collapsible-sub-item-indentation);
    }
}


// ----------------------------------------------------------
// :: 2.2. Desktop mode
// ----------------------------------------------------------

@media (min-width: $sm-dox__desktop-vp) {

    /* Switch to desktop layout
    -----------------------------------------------
       These transform the menu tree from
       collapsible to desktop (navbar + dropdowns)
    -----------------------------------------------*/
    /* start... (it's not recommended editing these rules) */
    .sm-dox ul{position:absolute;width:12em;}
    .sm-dox li{float:left;}
    .sm-dox.sm-rtl li{float:right;}
    .sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none;}
    .sm-dox a{white-space:nowrap;}
    .sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal;}
    .sm-dox .sm-nowrap > li > a,.sm-dox .sm-nowrap > li > :not(ul) a{white-space:nowrap;}
    /* ...end */

    // Main menu box
    .sm-dox {
        padding: 0 $sm-dox__desktop-padding-horizontal;
        background-image: $sm-dox__desktop-bg;
        line-height: 36px;
        //@include border-radius($sm-dox__desktop-border-radius);

        // Main menu items
        a {
            // Sub menu indicators
            span.sub-arrow {
                top: 50%;
                margin-top: -(ceil($sm-dox__desktop-arrow-size / 2));
                right: $sm-dox__desktop-item-padding-horizontal;
                width: 0;
                height: 0;
                border-width: $sm-dox__desktop-arrow-size;
                border-style: solid dashed dashed dashed;
                border-color: $sm-dox__main-text-color transparent transparent transparent;
                background: transparent;
                @include border-radius(0);
            }

            &,
            &:focus,
            &:active,
            &:hover,
            &.highlighted {
                padding: $sm-dox__desktop-item-padding-vertical $sm-dox__desktop-item-padding-horizontal;
                /*color: $sm-dox__desktop-item-color;*/
                background-image:url('tab_s.png');
                background-repeat:no-repeat;
                background-position:right;
                @include border-radius(0 !important);
            }
            &:hover {
              background-image: url('tab_a.png');
              background-repeat:repeat-x;
              color: $sm-dox__main-highlight-color;
              text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
              span.sub-arrow {
                border-color: $sm-dox__main-highlight-color transparent transparent transparent;
              }
            }

            // Make room for the sub arrows
            &.has-submenu {
                padding-right: $sm-dox__desktop-item-padding-horizontal + $sm-dox__desktop-arrow-size * 2 + $sm-dox__desktop-arrow-spacing;
            }
        }

        // No main menu items separators
        li {
            border-top: 0;
        }

        // First sub level carets
        > li > ul:before,
        > li > ul:after {
            content: '';
            position: absolute;
            top: -($sm-dox__desktop-sub-caret-size * 2 + $sm-dox__border-width * 2);
            left: $sm-dox__desktop-sub-caret-left;
            width: 0;
            height: 0;
            overflow: hidden;
            border-width: ($sm-dox__desktop-sub-caret-size + $sm-dox__border-width);
            border-style: dashed dashed solid dashed;
            border-color: transparent transparent $sm-dox__gray-dark transparent;
        }
        > li > ul:after {
            top: -($sm-dox__desktop-sub-caret-size * 2);
            left: ($sm-dox__desktop-sub-caret-left + $sm-dox__border-width);
            border-width: $sm-dox__desktop-sub-caret-size;
            border-color: transparent transparent $sm-dox__desktop-sub-bg transparent;
        }

        // Sub menus box
        ul {
            border: $sm-dox__border-width solid $sm-dox__gray-dark;
            padding: $sm-dox__desktop-sub-padding-vertical $sm-dox__desktop-sub-padding-horizontal;
            background: $sm-dox__desktop-sub-bg;
            @include border-radius($sm-dox__desktop-sub-border-radius !important);
            @include box-shadow($sm-dox__desktop-sub-box-shadow);

            // Sub menus items
            a {
                 span.sub-arrow {
                  right: 8px;
                  top: 50%;
                  margin-top: -$sm-dox__desktop-sub-arrow-size;
                  border-width: $sm-dox__desktop-sub-arrow-size;
                  border-color: transparent transparent transparent $sm-dox__desktop-sub-item-color;
                  border-style: dashed dashed dashed solid;
                }

                &,
                &:hover,
                &:focus,
                &:active,
                &.highlighted {
                    color: $sm-dox__desktop-sub-item-color;
                    background-image:none;
                    border: 0 !important;
                    color: $sm-dox__desktop-sub-item-color;
                    background-image:none;
                }

                &:hover {
                    background-image: url('tab_a.png');
                    background-repeat:repeat-x;
                    color: $sm-dox__main-highlight-color;
                    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
                  span.sub-arrow {
                    border-color: transparent transparent transparent $sm-dox__main-highlight-color;
                  }
                }
            }
        }

        // Scrolling arrows containers for tall sub menus - test sub menu: "Sub test" -> "more..." in the default download package
        span.scroll-up,
        span.scroll-down {
            position: absolute;
            display: none;
            visibility: hidden;
            overflow: hidden;
            background: $sm-dox__desktop-sub-bg;
            height: 36px;
            // width and position will be set automatically by the script

            &:hover {
                background: $sm-dox__desktop-sub-item-hover-bg;
            }
        }
        span.scroll-up:hover span.scroll-up-arrow {
            border-color: transparent transparent $sm-dox__desktop-sub-item-hover-color transparent;
        }
        span.scroll-down:hover span.scroll-down-arrow {
            border-color: $sm-dox__desktop-sub-item-hover-color transparent transparent transparent;
        }
        span.scroll-up-arrow {
            position: absolute;
            top: 0;
            left: 50%;
            margin-left: -6px;
            // we will use one-side border to create a triangle so that we don't use a real background image, of course, you can use a real image if you like too
            width: 0;
            height: 0;
            overflow: hidden;
            border-width: 6px; // tweak size of the arrow
            border-style: dashed dashed solid dashed;
            border-color: transparent transparent $sm-dox__desktop-sub-item-color transparent;
        }
        span.scroll-down-arrow {
            @extend span.scroll-up-arrow;
            top: 8px;
            border-style: solid dashed dashed dashed;
            border-color: $sm-dox__desktop-sub-item-color transparent transparent transparent;
        }


        // Rigth-to-left

        // Main menu box
        &.sm-rtl {

            // Main menu items
            a {

                // Make room for the sub arrows
                &.has-submenu {
                    padding-right: $sm-dox__desktop-item-padding-horizontal;
                    padding-left: $sm-dox__desktop-item-padding-horizontal + $sm-dox__desktop-arrow-size * 2 + $sm-dox__desktop-arrow-spacing;
                }

                // Sub menu indicators
                span.sub-arrow {
                    right: auto;
                    left: $sm-dox__desktop-item-padding-horizontal;
                }
            }

            // Vertical main menu items
            &.sm-vertical {
                a {

                    // No need for additional room for the sub arrows
                    &.has-submenu {
                        padding: $sm-dox__desktop-vertical-item-padding-vertical $sm-dox__desktop-vertical-item-padding-horizontal;
                    }

                    // Sub menu indicators
                    span.sub-arrow {
                        right: auto;
                        left: 8px;
                        border-style: dashed solid dashed dashed;
                        border-color: transparent $sm-dox__desktop-arrow-color transparent transparent;
                    }
                }
            }

            // First sub level carets
            > li > ul:before {
                left: auto;
                right: $sm-dox__desktop-sub-caret-left;
            }
            > li > ul:after {
                left: auto;
                right: ($sm-dox__desktop-sub-caret-left + $sm-dox__border-width);
            }

            // Sub menus box
            ul {
                a {

                    // No need for additional room for the sub arrows
                    &.has-submenu {
                        padding: $sm-dox__desktop-sub-item-padding-vertical $sm-dox__desktop-sub-item-padding-horizontal !important;
                    }

                    // Sub menu indicators
                    span.sub-arrow {
                        right: auto;
                        left: 8px;
                        border-style: dashed solid dashed dashed;
                        border-color: transparent $sm-dox__desktop-arrow-color transparent transparent;
                    }
                }
            }
        }


        // Vertical main menu

        // Main menu box
        &.sm-vertical {
            padding: $sm-dox__desktop-vertical-padding-vertical 0;
            @include border-radius($sm-dox__desktop-vertical-border-radius);

            // Main menu items
            a {
                padding: $sm-dox__desktop-vertical-item-padding-vertical $sm-dox__desktop-vertical-item-padding-horizontal;

                &:hover,
                &:focus,
                &:active,
                &.highlighted {
                    background: $sm-dox__desktop-vertical-item-hover-bg;
                }

                &.disabled {
                    background-image: $sm-dox__desktop-bg;
                }

                // Sub menu indicators
                span.sub-arrow {
                    right: 8px;
                    top: 50%;
                    margin-top: -$sm-dox__desktop-sub-arrow-size;
                    border-width: $sm-dox__desktop-sub-arrow-size;
                    border-style: dashed dashed dashed solid;
                    border-color: transparent transparent transparent $sm-dox__desktop-arrow-color;
                }
            }

            // No sub level carets
            > li > ul:before,
            > li > ul:after {
                display: none;
            }

            // Sub menus box
            ul {

                // Sub menus items
                a {
                    padding: $sm-dox__desktop-sub-item-padding-vertical $sm-dox__desktop-sub-item-padding-horizontal;

                    &:hover,
                    &:focus,
                    &:active,
                    &.highlighted {
                        background: $sm-dox__desktop-sub-item-hover-bg;
                    }

                    &.disabled {
                        background: $sm-dox__desktop-sub-bg;
                    }
                }
            }
        }
    }
}