|
96 | 96 |
|
97 | 97 | // Navigation link
|
98 | 98 | &__link {
|
99 |
| - display: block; |
| 99 | + display: flex; |
| 100 | + align-items: center; |
| 101 | + justify-content: space-between; |
100 | 102 | margin-top: 0.625em;
|
101 | 103 | overflow: hidden;
|
102 | 104 | text-overflow: ellipsis;
|
103 | 105 | cursor: pointer;
|
104 | 106 | transition: color 125ms;
|
105 | 107 | scroll-snap-align: start;
|
106 | 108 |
|
107 |
| - // Link in blurred state |
| 109 | + // Navigation link in blurred state |
108 | 110 | &[data-md-state="blur"] {
|
109 | 111 | color: var(--md-default-fg-color--light);
|
110 | 112 | }
|
|
114 | 116 | color: var(--md-typeset-a-color);
|
115 | 117 | }
|
116 | 118 |
|
117 |
| - // Navigation link in nested list |
118 |
| - .md-nav__item--nested > & { |
119 |
| - color: inherit; |
| 119 | + // Stretch section index link to full width |
| 120 | + .md-nav__item &--index [href] { |
| 121 | + width: 100%; |
120 | 122 | }
|
121 | 123 |
|
122 | 124 | // Navigation link on focus/hover
|
|
131 | 133 | outline-offset: px2rem(4px);
|
132 | 134 | }
|
133 | 135 |
|
134 |
| - // Navigation link to table of contents |
| 136 | + // Navigation link for table of contents |
135 | 137 | .md-nav--primary &[for="__toc"] {
|
136 | 138 | display: none;
|
137 | 139 |
|
|
149 | 151 | display: none;
|
150 | 152 | }
|
151 | 153 | }
|
| 154 | + |
| 155 | + // Navigation link children (for section indexes) |
| 156 | + > * { |
| 157 | + display: flex; |
| 158 | + cursor: pointer; |
| 159 | + } |
152 | 160 | }
|
153 | 161 |
|
154 | 162 | // Repository information container
|
|
272 | 280 | padding: 0;
|
273 | 281 | border-top: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
274 | 282 |
|
275 |
| - // Navigation link in nested navigation |
276 |
| - &--nested > .md-nav__link { |
277 |
| - padding-right: px2rem(48px); |
278 |
| - |
279 |
| - // Adjust for right-to-left languages |
280 |
| - [dir="rtl"] & { |
281 |
| - padding-right: px2rem(16px); |
282 |
| - padding-left: px2rem(48px); |
283 |
| - } |
284 |
| - } |
285 |
| - |
286 | 283 | // Navigation link in active navigation
|
287 | 284 | &--active > .md-nav__link {
|
288 | 285 | color: var(--md-typeset-a-color);
|
|
297 | 294 |
|
298 | 295 | // Navigation link
|
299 | 296 | .md-nav__link {
|
300 |
| - position: relative; |
301 | 297 | margin-top: 0;
|
302 | 298 | padding: px2rem(12px) px2rem(16px);
|
303 | 299 |
|
304 | 300 | // Navigation icon
|
305 | 301 | .md-nav__icon {
|
306 |
| - position: absolute; |
307 |
| - top: 50%; |
308 |
| - right: px2rem(12px); |
| 302 | + flex-shrink: 0; |
309 | 303 | width: px2rem(24px);
|
310 | 304 | height: px2rem(24px);
|
311 |
| - margin-top: px2rem(-12px); |
312 |
| - color: inherit; |
| 305 | + margin-right: px2rem(-4px); |
313 | 306 | font-size: px2rem(24px);
|
314 | 307 |
|
315 |
| - // Adjust for right-to-left languages |
316 |
| - [dir="rtl"] & { |
317 |
| - right: initial; |
318 |
| - left: px2rem(12px); |
319 |
| - } |
320 |
| - |
321 | 308 | // Navigation icon in link to next level
|
322 | 309 | &::after {
|
323 | 310 | display: block;
|
|
344 | 331 | // Table of contents contained in primary navigation
|
345 | 332 | .md-nav--secondary {
|
346 | 333 |
|
347 |
| - // Navigation link - omit unnecessary layering |
348 |
| - .md-nav__link { |
349 |
| - position: static; |
350 |
| - } |
351 |
| - |
352 | 334 | // Navigation on level 2-6
|
353 | 335 | .md-nav {
|
354 | 336 | position: static;
|
|
442 | 424 |
|
443 | 425 | // Show link to table of contents
|
444 | 426 | &--primary &__link[for="__toc"] {
|
445 |
| - display: block; |
446 |
| - padding-right: px2rem(48px); |
447 |
| - |
448 |
| - // Adjust for right-to-left languages |
449 |
| - [dir="rtl"] & { |
450 |
| - padding-right: px2rem(16px); |
451 |
| - padding-left: px2rem(48px); |
452 |
| - } |
| 427 | + display: flex; |
453 | 428 |
|
454 | 429 | // Show table of contents icon
|
455 | 430 | .md-icon::after {
|
|
481 | 456 |
|
482 | 457 | // Show link to integrated table of contents
|
483 | 458 | &--integrated &__link[for="__toc"] {
|
484 |
| - display: block; |
485 |
| - padding-right: px2rem(48px); |
486 |
| - scroll-snap-align: initial; |
487 |
| - |
488 |
| - // Adjust for right-to-left languages |
489 |
| - [dir="rtl"] & { |
490 |
| - padding-right: px2rem(16px); |
491 |
| - padding-left: px2rem(48px); |
492 |
| - } |
| 459 | + display: flex; |
493 | 460 |
|
494 | 461 | // Show table of contents icon
|
495 | 462 | .md-icon::after {
|
|
570 | 537 | margin-bottom: 0;
|
571 | 538 | }
|
572 | 539 |
|
573 |
| - // Hide navigation link, as sections are always expanded |
| 540 | + // Show navigation link as title |
574 | 541 | > .md-nav__link {
|
575 |
| - display: none; |
| 542 | + font-weight: 700; |
| 543 | + pointer-events: none; |
| 544 | + |
| 545 | + // Make navigation link clickable |
| 546 | + &--index [href] { |
| 547 | + pointer-events: initial; |
| 548 | + } |
| 549 | + |
| 550 | + // Hide naviation icon |
| 551 | + .md-nav__icon { |
| 552 | + display: none; |
| 553 | + } |
576 | 554 | }
|
577 | 555 |
|
578 | 556 | // Navigation
|
579 | 557 | > .md-nav {
|
580 | 558 | display: block;
|
581 | 559 |
|
582 |
| - // Navigation title |
583 |
| - > .md-nav__title { |
584 |
| - display: block; |
585 |
| - padding: 0; |
586 |
| - pointer-events: none; |
587 |
| - scroll-snap-align: start; |
588 |
| - } |
589 |
| - |
590 | 560 | // Adjust spacing on next level item
|
591 | 561 | > .md-nav__list > .md-nav__item {
|
592 | 562 | padding: 0;
|
|
630 | 600 | // Modifier for when navigation tabs are rendered
|
631 | 601 | &--lifted {
|
632 | 602 |
|
633 |
| - // Hide nested level 0 items and site title |
| 603 | + // Hide nested level 0 navigation items and site title |
634 | 604 | > .md-nav__list > .md-nav__item--nested,
|
635 | 605 | > .md-nav__title {
|
636 | 606 | display: none;
|
637 | 607 | }
|
638 | 608 |
|
639 |
| - // Hide level 0 items |
| 609 | + // Hide level 0 navigation items |
640 | 610 | > .md-nav__list > .md-nav__item {
|
641 | 611 | display: none;
|
642 | 612 |
|
|
645 | 615 | display: block;
|
646 | 616 | padding: 0;
|
647 | 617 |
|
648 |
| - // Hide nested links |
| 618 | + // Show navigation link as title |
649 | 619 | > .md-nav__link {
|
650 |
| - display: none; |
651 |
| - } |
652 |
| - |
653 |
| - // Show title and adjust spacing |
654 |
| - > .md-nav > .md-nav__title { |
655 |
| - display: block; |
656 | 620 | padding: 0 px2rem(12px);
|
| 621 | + font-weight: 700; |
657 | 622 | pointer-events: none;
|
658 |
| - scroll-snap-align: start; |
| 623 | + |
| 624 | + // Make navigation link clickable |
| 625 | + &--index [href] { |
| 626 | + pointer-events: initial; |
| 627 | + } |
| 628 | + |
| 629 | + // Hide naviation icon |
| 630 | + .md-nav__icon { |
| 631 | + display: none; |
| 632 | + } |
659 | 633 | }
|
660 | 634 | }
|
661 | 635 | }
|
|
665 | 639 | .md-nav[data-md-level="1"] {
|
666 | 640 | display: block;
|
667 | 641 |
|
668 |
| - // Adjust spacing for level 1 items |
| 642 | + // Adjust spacing for level 1 navigation items |
669 | 643 | > .md-nav__list > .md-nav__item {
|
670 | 644 | padding-right: px2rem(12px);
|
671 | 645 | }
|
|
0 commit comments