material-sass 4.0.0.alpha6 → 4.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +36 -8
  4. data/Rakefile +16 -3
  5. data/app/assets/javascripts/material-sprockets.js +6 -1
  6. data/app/assets/javascripts/material.js +654 -417
  7. data/app/assets/javascripts/material.min.js +1 -0
  8. data/app/assets/javascripts/material/addons/picker.date.js +234 -0
  9. data/app/assets/javascripts/material/addons/picker.js +172 -0
  10. data/app/assets/javascripts/material/addons/textarea-autosize.js +20 -2
  11. data/app/assets/javascripts/material/addons/waves.js +127 -0
  12. data/app/assets/javascripts/material/components/floating-label.js +92 -0
  13. data/app/assets/javascripts/material/components/navdrawer.js +353 -0
  14. data/app/assets/javascripts/material/components/selection-control-focus.js +47 -0
  15. data/app/assets/javascripts/material/components/tab-switch.js +148 -0
  16. data/app/assets/javascripts/material/components/util.js +133 -0
  17. data/app/assets/javascripts/material/initializers/picker.js +171 -0
  18. data/app/assets/javascripts/material/initializers/textarea-autosize.js +10 -0
  19. data/app/assets/javascripts/material/initializers/waves.js +13 -0
  20. data/app/assets/stylesheets/material/_colours.scss +324 -0
  21. data/app/assets/stylesheets/material/_functions.scss +65 -0
  22. data/app/assets/stylesheets/material/_mixins.scss +23 -23
  23. data/app/assets/stylesheets/material/_print.scss +102 -0
  24. data/app/assets/stylesheets/material/_utilities.scss +21 -17
  25. data/app/assets/stylesheets/material/_variables.scss +13 -42
  26. data/app/assets/stylesheets/material/base/_base.scss +420 -5
  27. data/app/assets/stylesheets/material/base/_grid.scss +34 -33
  28. data/app/assets/stylesheets/material/base/_typography.scss +165 -174
  29. data/app/assets/stylesheets/material/bootstrap/_alert.scss +32 -39
  30. data/app/assets/stylesheets/material/bootstrap/_badge.scss +34 -0
  31. data/app/assets/stylesheets/material/bootstrap/_breadcrumb.scss +18 -18
  32. data/app/assets/stylesheets/material/bootstrap/_carousel.scss +127 -142
  33. data/app/assets/stylesheets/material/bootstrap/_close.scss +18 -19
  34. data/app/assets/stylesheets/material/bootstrap/_code.scss +10 -7
  35. data/app/assets/stylesheets/material/bootstrap/_custom-form.scss +50 -56
  36. data/app/assets/stylesheets/material/bootstrap/_form.scss +159 -129
  37. data/app/assets/stylesheets/material/bootstrap/_image.scss +19 -16
  38. data/app/assets/stylesheets/material/bootstrap/_jumbotron.scss +10 -7
  39. data/app/assets/stylesheets/material/bootstrap/_nav.scss +71 -69
  40. data/app/assets/stylesheets/material/bootstrap/_pagination.scss +34 -26
  41. data/app/assets/stylesheets/material/bootstrap/_popover.scss +26 -59
  42. data/app/assets/stylesheets/material/bootstrap/_responsive-embed.scss +4 -4
  43. data/app/assets/stylesheets/material/bootstrap/_transition.scss +10 -8
  44. data/app/assets/stylesheets/material/material.scss +75 -62
  45. data/app/assets/stylesheets/material/material/_button-flat.scss +26 -39
  46. data/app/assets/stylesheets/material/material/_button-float.scss +10 -14
  47. data/app/assets/stylesheets/material/material/_button-group.scss +268 -0
  48. data/app/assets/stylesheets/material/material/_button.scss +133 -189
  49. data/app/assets/stylesheets/material/material/_card.scss +300 -248
  50. data/app/assets/stylesheets/material/material/_chip.scss +65 -64
  51. data/app/assets/stylesheets/material/material/_data-table.scss +135 -45
  52. data/app/assets/stylesheets/material/material/_dialog.scss +141 -110
  53. data/app/assets/stylesheets/material/material/_expansion-panel.scss +86 -119
  54. data/app/assets/stylesheets/material/material/_menu.scss +308 -228
  55. data/app/assets/stylesheets/material/material/_navdrawer.scss +239 -234
  56. data/app/assets/stylesheets/material/material/_picker.scss +157 -155
  57. data/app/assets/stylesheets/material/material/_progress-circular.scss +80 -80
  58. data/app/assets/stylesheets/material/material/_progress.scss +180 -115
  59. data/app/assets/stylesheets/material/material/_selection-control.scss +132 -139
  60. data/app/assets/stylesheets/material/material/_stepper.scss +94 -93
  61. data/app/assets/stylesheets/material/material/_tab.scss +74 -93
  62. data/app/assets/stylesheets/material/material/_text-field-floating-label.scss +29 -20
  63. data/app/assets/stylesheets/material/material/_text-field-input-group.scss +94 -24
  64. data/app/assets/stylesheets/material/material/_text-field-textarea.scss +13 -26
  65. data/app/assets/stylesheets/material/material/_text-field.scss +127 -118
  66. data/app/assets/stylesheets/material/material/_toolbar.scss +308 -313
  67. data/app/assets/stylesheets/material/material/_tooltip.scss +23 -62
  68. data/app/assets/stylesheets/material/mixins/_background-variant.scss +6 -6
  69. data/app/assets/stylesheets/material/mixins/_border-radius.scss +17 -17
  70. data/app/assets/stylesheets/material/mixins/_breakpoint.scss +32 -2
  71. data/app/assets/stylesheets/material/mixins/_clearfix.scss +1 -1
  72. data/app/assets/stylesheets/material/mixins/_form.scss +62 -25
  73. data/app/assets/stylesheets/material/mixins/_grid-framework.scss +8 -16
  74. data/app/assets/stylesheets/material/mixins/_grid.scss +40 -64
  75. data/app/assets/stylesheets/material/mixins/_material-icons.scss +36 -0
  76. data/app/assets/stylesheets/material/mixins/_nav-divider.scss +1 -1
  77. data/app/assets/stylesheets/material/mixins/_reset-text.scss +2 -21
  78. data/app/assets/stylesheets/material/mixins/_screenreader.scss +14 -12
  79. data/app/assets/stylesheets/material/mixins/_text-alignment.scss +23 -0
  80. data/app/assets/stylesheets/material/mixins/_text-emphasis.scss +6 -6
  81. data/app/assets/stylesheets/material/mixins/_transition.scss +42 -10
  82. data/app/assets/stylesheets/material/utilities/_background.scss +18 -18
  83. data/app/assets/stylesheets/material/utilities/_border.scss +88 -41
  84. data/app/assets/stylesheets/material/utilities/_display.scss +63 -30
  85. data/app/assets/stylesheets/material/utilities/_flex.scss +139 -134
  86. data/app/assets/stylesheets/material/utilities/_material-icons.scss +3 -5
  87. data/app/assets/stylesheets/material/utilities/_position.scss +19 -22
  88. data/app/assets/stylesheets/material/utilities/_sizing.scss +11 -12
  89. data/app/assets/stylesheets/material/utilities/_spacing.scss +51 -56
  90. data/app/assets/stylesheets/material/utilities/_text.scss +80 -75
  91. data/app/assets/stylesheets/material/utilities/_visibility.scss +5 -46
  92. data/app/assets/stylesheets/material/utilities/_waves.scss +11 -18
  93. data/app/assets/stylesheets/material/variables/_elevation-shadow.scss +89 -82
  94. data/app/assets/stylesheets/material/variables/_grid.scss +29 -26
  95. data/app/assets/stylesheets/material/variables/_palette.scss +45 -0
  96. data/app/assets/stylesheets/material/variables/_spacer.scss +34 -88
  97. data/app/assets/stylesheets/material/variables/_transition.scss +29 -0
  98. data/app/assets/stylesheets/material/variables/_typography.scss +88 -74
  99. data/app/assets/stylesheets/material/variables/_variable-bootstrap.scss +196 -133
  100. data/app/assets/stylesheets/material/variables/_variable-material.scss +481 -429
  101. data/lib/material-sass/version.rb +1 -1
  102. data/material-sass.gemspec +3 -3
  103. metadata +26 -21
  104. data/app/assets/javascripts/material/addons-materialise/pickadate.js +0 -139
  105. data/app/assets/javascripts/material/addons-materialise/textarea-autosize.js +0 -11
  106. data/app/assets/javascripts/material/addons-materialise/wave.js +0 -15
  107. data/app/assets/javascripts/material/addons/pickadate.js +0 -7
  108. data/app/assets/javascripts/material/addons/wave.js +0 -5
  109. data/app/assets/javascripts/material/src/floating-label.js +0 -91
  110. data/app/assets/javascripts/material/src/navdrawer.js +0 -352
  111. data/app/assets/javascripts/material/src/tab-switch.js +0 -133
  112. data/app/assets/javascripts/material/src/util.js +0 -138
  113. data/app/assets/stylesheets/material/base/_normalize.scss +0 -253
  114. data/app/assets/stylesheets/material/base/_reboot.scss +0 -239
  115. data/app/assets/stylesheets/material/bootstrap/_button-group.scss +0 -134
  116. data/app/assets/stylesheets/material/mixins/_tab-focus.scss +0 -5
  117. data/app/assets/stylesheets/material/mixins/_transform.scss +0 -9
  118. data/app/assets/stylesheets/material/variables/_animation.scss +0 -22
  119. data/app/assets/stylesheets/material/variables/_colour.scss +0 -389
@@ -1,10 +1,3 @@
1
- //
2
- // todo: bootstrap accordion (i.e. material expansion panel)
3
- // since bootstrap accordion now relies on `.card`
4
- // some tweaks are needed for the default accordion example to work correctly
5
- // we probably need a wrapper to add additional styles in line with material design guidelines
6
- //
7
-
8
1
  .list-group {
9
2
  display: flex;
10
3
  flex-direction: column;
@@ -12,140 +5,114 @@
12
5
  padding-left: 0;
13
6
  }
14
7
 
15
- //
16
- // item
17
- //
18
- .list-group-item {
19
- align-items: center;
20
- background-color: $expansion-panel-bg;
21
- border: 0;
22
- border-bottom: $expansion-panel-border-width solid $expansion-panel-border-color;
23
- box-shadow: map-get($expansion-panel-elevation-shadow, shadow);
8
+ .list-group-item {
9
+ @include transition-standard(background-color, color);
10
+
11
+ background-color: $expansion-panel-bg;
12
+ border: 0;
13
+ box-shadow: map-get($expansion-panel-elevation-shadow, shadow);
14
+ color: $expansion-panel-color;
15
+ display: block;
16
+ font-size: $expansion-panel-font-size;
17
+ line-height: $expansion-panel-line-height;
18
+ min-height: $expansion-panel-height;
19
+ padding: $expansion-panel-padding-y $expansion-panel-padding-x;
20
+ position: relative;
21
+
22
+ @include active-focus-hover {
24
23
  color: $expansion-panel-color;
25
- display: flex;
26
- flex-flow: row wrap;
27
- font-size: $expansion-panel-font-size;
28
- min-height: $expansion-panel-height;
29
- padding: $expansion-panel-inner-spacer-y $expansion-panel-inner-spacer-x;
30
- position: relative;
31
- @include transition-standard(background-color, color);
32
-
33
- &:first-child {
34
- @include border-top-radius($border-radius);
35
- }
36
-
37
- &:last-child {
38
- border-bottom: 0;
39
- @include border-bottom-radius($border-radius);
40
- }
24
+ text-decoration: none;
25
+ }
41
26
 
42
- // active, focus, hover
43
- @include active-focus-hover {
44
- color: $expansion-panel-color;
45
- text-decoration: none;
46
- }
27
+ &:disabled,
28
+ &.disabled {
29
+ background-color: $expansion-panel-bg;
30
+ color: $expansion-panel-color-disabled;
31
+ }
47
32
 
48
- &.active {
49
- background-color: $expansion-panel-bg-active;
50
- }
33
+ &:first-child {
34
+ @include border-top-radius($expansion-panel-border-radius);
35
+ }
51
36
 
52
- // disabled
53
- &.disabled {
54
- background-color: $expansion-panel-bg-disabled;
55
- color: $expansion-panel-color-disabled;
56
- cursor: $cursor-disabled;
57
- }
37
+ &:last-child {
38
+ @include border-bottom-radius($expansion-panel-border-radius);
58
39
  }
59
40
 
60
- .list-group-item-action {
41
+ &.active {
42
+ background-color: $expansion-panel-bg-active;
61
43
  color: $expansion-panel-color;
62
- text-align: inherit;
63
- width: 100%;
44
+ }
64
45
 
65
- // active, focus, hover
66
- @include active-focus-hover {
67
- background-color: $expansion-panel-bg-active;
68
- }
46
+ .card & {
47
+ padding-right: $card-padding-x;
48
+ padding-left: $card-padding-x;
49
+ }
50
+ }
69
51
 
70
- &:focus {
71
- outline: 0;
72
- }
52
+ .list-group-item-action {
53
+ color: $expansion-panel-color;
54
+ text-align: inherit;
55
+ width: 100%;
73
56
 
74
- // disabled
75
- &.disabled {
76
- background-color: $expansion-panel-bg-disabled;
77
- }
57
+ @include active-focus-hover {
58
+ background-color: $expansion-panel-bg-active;
59
+ color: $expansion-panel-color;
78
60
  }
79
61
 
80
- // colour
81
- @each $color in $palettes {
82
- $i: index($palettes, $color);
83
-
84
- .list-group-item-#{$color} {
85
- background-color: nth($palettes-color, $i);
86
- color: nth($palettes-text-color, $i);
87
-
88
- // active, focus, hover
89
- @include active-focus-hover {
90
- color: nth($palettes-text-color, $i);
91
- }
92
-
93
- &.active {
94
- background-color: nth($palettes-color-dark, $i);
95
- color: nth($palettes-text-color-dark, $i);
96
- }
97
-
98
- &.list-group-item-action {
99
- // active, focus, hover
100
- @include active-focus-hover {
101
- background-color: nth($palettes-color-dark, $i);
102
- color: nth($palettes-text-color-dark, $i);
103
- }
104
- }
105
- }
106
- }
62
+ &:disabled,
63
+ &.disabled {
64
+ background-color: $expansion-panel-bg;
65
+ color: $expansion-panel-color-disabled;
66
+ }
107
67
 
108
- //
109
- // flush
110
- //
111
- .list-group-flush {
112
- .list-group-item {
113
- border-radius: 0;
114
- box-shadow: none;
68
+ &:focus {
69
+ outline: 0;
70
+ }
71
+ }
115
72
 
116
- &:first-child {
117
- border-top: $expansion-panel-border-width solid $expansion-panel-border-color;
118
- }
73
+ // Colour
74
+ @each $color, $values in $theme-colors {
75
+ .list-group-item-#{$color} {
76
+ @include color-yiq(map-get(theme-color($color), lighter));
119
77
 
120
- &:last-child {
121
- border-bottom: $expansion-panel-border-width solid $expansion-panel-border-color;
122
- }
78
+ background-color: map-get(theme-color($color), lighter);
79
+
80
+ &.active {
81
+ @include color-yiq(map-get(theme-color($color), color));
82
+
83
+ background-color: map-get(theme-color($color), color);
123
84
  }
124
85
 
125
- &:first-child .list-group-item:first-child {
126
- border-top: 0;
86
+ &.list-group-item-action {
87
+ @include active-focus-hover {
88
+ @include color-yiq(map-get(theme-color($color), color));
89
+
90
+ background-color: map-get(theme-color($color), color);
91
+ }
127
92
  }
93
+ }
94
+ }
95
+
96
+
128
97
 
129
- &:last-child .list-group-item:last-child {
130
- border-bottom: 0;
98
+ // Flush
99
+
100
+ .list-group-flush {
101
+ .list-group-item {
102
+ border-top: $expansion-panel-border-width solid $expansion-panel-border-color;
103
+ border-radius: 0;
104
+ box-shadow: none;
105
+
106
+ &:last-child {
107
+ border-bottom: $expansion-panel-border-width solid $expansion-panel-border-color;
131
108
  }
132
109
  }
133
110
 
134
- //
135
- // misc
136
- //
137
- .list-group-item-heading {
138
- color: inherit;
139
- font-size: $expansion-panel-font-size;
140
- line-height: $line-height-base;
141
- margin-top: 0;
142
- margin-bottom: 0;
111
+ &:first-child .list-group-item:first-child {
112
+ border-top: 0;
143
113
  }
144
114
 
145
- .list-group-item-text {
146
- color: inherit;
147
- font-size: $expansion-panel-font-size-secondary;
148
- line-height: $line-height-base;
149
- margin-top: 0;
150
- margin-bottom: 0;
115
+ &:last-child .list-group-item:last-child {
116
+ border-bottom: 0;
151
117
  }
118
+ }
@@ -3,12 +3,11 @@
3
3
  position: relative;
4
4
  }
5
5
 
6
- .dropdown-menu,
7
- .menu {
8
- background-clip: padding-box;
9
- background-color: $menu-bg;
10
- border: 0;
11
- box-shadow: map-get($menu-elevation-shadow, shadow);
6
+ .dropdown-menu {
7
+ @include border-bottom-radius($menu-border-radius);
8
+ @include text-align(left);
9
+
10
+ background-color: transparent;
12
11
  color: inherit;
13
12
  display: none;
14
13
  float: left;
@@ -19,278 +18,359 @@
19
18
  min-width: $menu-min-width;
20
19
  padding: $menu-padding-y 0;
21
20
  position: absolute;
22
- left: 0;
23
- text-align: left;
24
21
  z-index: map-get($menu-elevation-shadow, elevation);
25
- }
26
-
27
- .dropdown-menu {
28
- // position
29
- top: 100%;
30
- transform-origin: 0 0;
31
- @include border-bottom-radius($border-radius);
32
- }
33
22
 
34
- .menu {
35
- // position
36
- top: calc(50% - #{$menu-link-height / 2 + $menu-padding-y});
37
- transform-origin: 0 ($menu-link-height / 2 + $menu-padding-y);
38
- @include border-radius($border-radius);
39
- }
40
-
41
- .dropup {
42
- .dropdown-menu,
43
- .menu {
44
- // position
45
- top: auto;
46
- }
23
+ &::before {
24
+ @include border-bottom-radius($menu-border-radius);
47
25
 
48
- .dropdown-menu {
49
- // position
50
- bottom: 100%;
51
- transform-origin: 0 100%;
52
- @include border-top-radius($border-radius);
53
- @include border-bottom-radius(0);
54
- }
55
-
56
- .menu {
57
- // position
58
- bottom: calc(50% - #{$menu-link-height / 2 + $menu-padding-y});
59
- transform-origin: 0 calc(100% - #{$menu-link-height / 2 + $menu-padding-y});
26
+ background-clip: padding-box;
27
+ background-color: $menu-bg;
28
+ box-shadow: map-get($menu-elevation-shadow, shadow);
29
+ content: '';
30
+ display: block;
31
+ position: absolute;
32
+ top: 0;
33
+ right: 0;
34
+ bottom: 0;
35
+ left: 0;
36
+ transform-origin: 0 0;
37
+ z-index: -1;
60
38
  }
61
- }
62
39
 
63
- // open
64
- .show {
65
- > a {
66
- outline: 0;
67
- }
40
+ &.show {
41
+ display: block;
68
42
 
69
- > .dropdown-menu,
70
- > .menu {
71
- animation-duration: $transition-duration-lg;
72
- animation-timing-function: $transition-timing-function-deceleration;
73
- display: block;
43
+ &::before,
44
+ > * {
45
+ animation-duration: $transition-duration-mobile;
46
+ animation-timing-function: $transition-timing-function-standard;
74
47
 
75
48
  @include media-breakpoint-up(sm) {
76
- transition-duration: $transition-duration-tablet-lg;
49
+ animation-duration: $transition-duration-tablet;
77
50
  }
78
51
 
79
52
  @include media-breakpoint-up(lg) {
80
- transition-duration: $transition-duration-desktop-lg;
53
+ animation-duration: $transition-duration-desktop;
81
54
  }
82
55
  }
83
56
 
84
- > .dropdown-menu {
85
- animation-name: dropdown-open;
57
+ &::before {
58
+ animation-name: dropdown-menu-show;
86
59
  }
87
60
 
88
- > .menu {
89
- animation-name: menu-open;
61
+ > * {
62
+ animation-name: dropdown-item-show;
90
63
  }
91
- }
92
64
 
93
- @keyframes dropdown-open {
94
- 0% {
95
- opacity: 0;
96
- // position
97
- top: 50%;
98
- transform: scale(0.87, 0.54);
65
+ > :nth-child(1) {
66
+ animation-name: dropdown-item-show-1;
99
67
  }
100
- 50% {
101
- opacity: 1;
68
+
69
+ > :nth-child(2) {
70
+ animation-name: dropdown-item-show-2;
102
71
  }
103
- 100% {
104
- opacity: 1;
105
- // position
106
- top: 100%;
107
- transform: scale(1, 1);
72
+
73
+ > :nth-child(3) {
74
+ animation-name: dropdown-item-show-3;
108
75
  }
109
76
  }
110
77
 
111
- @keyframes menu-open {
112
- 0% {
113
- opacity: 0;
114
- transform: scale(0.87, 0.54);
115
- }
116
- 50% {
117
- opacity: 1;
118
- }
119
- 100% {
120
- opacity: 1;
121
- transform: scale(1, 1);
122
- }
78
+ .nav:not(.flex-column):not(.flex-column-reverse) & {
79
+ min-width: 100%;
80
+ }
81
+ }
82
+
83
+ .menu {
84
+ @include border-radius($menu-border-radius);
85
+
86
+ margin-top: (($menu-link-height - ($menu-link-height - $menu-line-height) / 2) * -1 + $menu-padding-y * -1);
87
+
88
+ &::before {
89
+ @include border-radius($menu-border-radius);
90
+
91
+ transform-origin: 0 ($menu-link-height / 2 + $menu-padding-y);
123
92
  }
93
+ }
124
94
 
125
- .dropup.show {
126
- > .dropdown-menu {
127
- animation-name: dropup-open;
128
- }
95
+ .show > a {
96
+ outline: 0;
97
+ }
98
+
99
+ @keyframes dropdown-item-show {
100
+ 0% {
101
+ opacity: 0;
129
102
  }
130
103
 
131
- @keyframes dropup-open {
132
- 0% {
133
- opacity: 0;
134
- // position
135
- bottom: 50%;
136
- transform: scale(0.87, 0.54);
104
+ 99% {
105
+ opacity: 0;
106
+ }
107
+
108
+ 100% {
109
+ opacity: 1;
110
+ }
111
+ }
112
+
113
+ @keyframes dropdown-item-show-1 {
114
+ 0% {
115
+ opacity: 0;
116
+ }
117
+
118
+ 40% {
119
+ opacity: 0;
120
+ }
121
+
122
+ 100% {
123
+ opacity: 1;
124
+ }
125
+ }
126
+
127
+ @keyframes dropdown-item-show-2 {
128
+ 0% {
129
+ opacity: 0;
130
+ }
131
+
132
+ 60% {
133
+ opacity: 0;
134
+ }
135
+
136
+ 100% {
137
+ opacity: 1;
138
+ }
139
+ }
140
+
141
+ @keyframes dropdown-item-show-3 {
142
+ 0% {
143
+ opacity: 0;
144
+ }
145
+
146
+ 80% {
147
+ opacity: 0;
148
+ }
149
+
150
+ 100% {
151
+ opacity: 1;
152
+ }
153
+ }
154
+
155
+ @keyframes dropdown-menu-show {
156
+ 0% {
157
+ transform: scale(0, 0);
158
+ }
159
+
160
+ 20% {
161
+ transform: scale((1 / 3), 0);
162
+ }
163
+
164
+ 40% {
165
+ transform: scale((2 / 3), .25);
166
+ }
167
+
168
+ 60% {
169
+ transform: scale(1, .5);
170
+ }
171
+
172
+ 80% {
173
+ transform: scale(1, .75);
174
+ }
175
+
176
+ 100% {
177
+ transform: scale(1, 1);
178
+ }
179
+ }
180
+
181
+ @keyframes menu-animation {
182
+ 0% {
183
+ margin-top: (($menu-link-height + $menu-padding-y) * -1);
184
+ }
185
+
186
+ 100% {
187
+ margin-top: 0;
188
+ }
189
+ }
190
+
191
+ // Positioning
192
+ .dropdown-menu[x-placement="bottom-end"]::before {
193
+ transform-origin: 100% 0;
194
+ }
195
+
196
+ .dropdown-menu[x-placement="top-end"],
197
+ .dropdown-menu[x-placement="top-start"] {
198
+ &,
199
+ &::before {
200
+ @include border-top-radius($menu-border-radius);
201
+ @include border-bottom-radius(0);
202
+ }
203
+
204
+ &.show {
205
+ > :nth-child(1),
206
+ > :nth-child(2),
207
+ > :nth-child(3) {
208
+ animation-name: dropdown-item-show;
209
+ }
210
+
211
+ > :nth-last-child(1) {
212
+ animation-name: dropdown-item-show-1;
137
213
  }
138
- 50% {
139
- opacity: 1;
214
+
215
+ > :nth-last-child(2) {
216
+ animation-name: dropdown-item-show-2;
140
217
  }
141
- 100% {
142
- opacity: 1;
143
- // position
144
- bottom: 100%;
145
- transform: scale(1, 1);
218
+
219
+ > :nth-last-child(3) {
220
+ animation-name: dropdown-item-show-3;
146
221
  }
147
222
  }
223
+ }
224
+
225
+ .dropdown-menu[x-placement="top-end"]::before {
226
+ transform-origin: 100% 100%;
227
+ }
228
+
229
+ .dropdown-menu[x-placement="top-start"]::before {
230
+ transform-origin: 0 100%;
231
+ }
232
+
233
+ .menu[x-placement="bottom-end"]::before {
234
+ transform-origin: 100% ($menu-link-height / 2 + $menu-padding-y);
235
+ }
148
236
 
149
- // positioning
150
- .dropdown-menu-left,
151
- .menu-left {
152
- // position
153
- right: auto;
154
- left: 0;
237
+ .menu[x-placement="top-end"],
238
+ .menu[x-placement="top-start"] {
239
+ margin-top: 0;
240
+ margin-bottom: (($menu-link-height - ($menu-link-height - $menu-line-height) / 2) * -1 + $menu-padding-y * -1);
241
+ }
242
+
243
+ .menu[x-placement="top-end"]::before {
244
+ transform-origin: 100% calc(100% - #{$menu-link-height / 2 + $menu-padding-y});
245
+ }
246
+
247
+ .menu[x-placement="top-start"]::before {
248
+ transform-origin: 0 calc(100% - #{$menu-link-height / 2 + $menu-padding-y});
249
+ }
250
+
251
+ // Size
252
+ .dropdown-menu-sm,
253
+ .menu-cascading {
254
+ font-size: $menu-font-size-cascading;
255
+ line-height: $menu-line-height-cascading;
256
+ padding-top: $menu-padding-y-cascading;
257
+ padding-bottom: $menu-padding-y-cascading;
258
+
259
+ @include media-breakpoint-up(sm) {
260
+ min-width: $menu-min-width-cascading;
155
261
  }
262
+ }
156
263
 
157
- .dropdown-menu-right,
158
- .menu-right {
159
- // position
160
- right: 0;
161
- left: auto;
162
- transform-origin: 100% 0;
264
+ .menu-cascading {
265
+ margin-top: (($menu-link-height-cascading - ($menu-link-height-cascading - $menu-line-height-cascading) / 2) * -1 + $menu-padding-y-cascading * -1);
163
266
 
164
- .dropup & {
165
- transform-origin: 100% 100%;
166
- }
267
+ &[x-placement="top-end"],
268
+ &[x-placement="top-start"] {
269
+ margin-top: 0;
270
+ margin-bottom: (($menu-link-height-cascading - ($menu-link-height-cascading - $menu-line-height-cascading) / 2) * -1 + $menu-padding-y-cascading * -1);
167
271
  }
168
272
 
169
- // size
170
- .dropdown-menu-sm,
171
- .menu-cascading {
172
- font-size: $menu-font-size-cascading;
173
- line-height: $menu-line-height-cascading;
174
- padding: $menu-padding-y-cascading 0;
273
+ &[x-placement="top-end"]::before {
274
+ transform-origin: 100% calc(100% - #{$menu-link-height-cascading / 2 + $menu-padding-y-cascading});
275
+ }
175
276
 
176
- @include media-breakpoint-up(sm) {
177
- min-width: $menu-min-width-cascading;
178
- }
277
+ &[x-placement="top-start"]::before {
278
+ transform-origin: 0 calc(100% - #{$menu-link-height-cascading / 2 + $menu-padding-y-cascading});
179
279
  }
280
+ }
180
281
 
181
- //
182
- // backdrop to catch body clicks on mobile
183
- //
184
- .dropdown-backdrop {
185
- position: fixed;
186
- top: 0;
187
- right: 0;
188
- bottom: 0;
189
- left: 0;
190
- z-index: (map-get($menu-elevation-shadow, elevation) - 1);
191
- }
192
-
193
- //
194
- // button, link and more within the dropdown menu
195
- //
196
- .dropdown-item,
197
- .menu-item {
198
- background: none;
199
- border: 0;
200
- clear: both;
201
- color: $menu-link-color;
202
- display: block;
203
- font-weight: normal;
204
- padding: $menu-link-padding;
205
- position: relative;
206
- text-align: inherit;
207
- white-space: nowrap;
208
- width: 100%;
209
- @include transition-standard(background-color, color);
210
-
211
- // active, focus, hover
212
- @include active-focus-hover {
213
- background-color: $menu-link-bg-active;
214
- color: $menu-link-color;
215
-
216
- @if ($link-decoration-active != "none") {
217
- text-decoration: none;
218
- }
219
- }
220
282
 
221
- // disabled
222
- &.disabled {
223
- background-color: transparent;
224
- color: $menu-link-color-disabled;
225
- cursor: $cursor-disabled;
226
- }
227
283
 
228
- // size
229
- .dropdown-menu-sm &,
230
- .menu-cascading & {
231
- padding: $menu-link-padding-cascading;
232
- }
284
+ // Button, link and more within the dropdown menu
285
+
286
+ .dropdown-item {
287
+ @include transition-standard(background-color, color);
288
+
289
+ background: none;
290
+ border: 0;
291
+ clear: both;
292
+ color: $menu-link-color;
293
+ display: block;
294
+ font-weight: normal;
295
+ padding: $menu-link-padding-y $menu-link-padding-x;
296
+ position: relative;
297
+ text-align: inherit;
298
+ transform-origin: 0 0;
299
+ white-space: nowrap;
300
+ width: 100%;
301
+
302
+ @include active-focus-hover {
303
+ background-color: $menu-link-bg-hover;
304
+ color: $menu-link-color;
305
+ text-decoration: none;
233
306
  }
234
307
 
235
- //
236
- // divider
237
- //
238
- .dropdown-divider,
239
- .menu-divider {
240
- @include nav-divider($menu-divider-bg);
308
+ &.active {
309
+ background-color: $menu-link-bg-hover;
241
310
  }
242
311
 
243
- //
244
- // header
245
- //
246
- .dropdown-header,
247
- .menu-header {
248
- color: $menu-link-color;
249
- display: block;
250
- font-size: $menu-font-size;
251
- font-weight: bolder;
252
- line-height: $menu-line-height;
253
- margin: 0;
254
- padding: $menu-link-padding;
255
- white-space: nowrap;
256
-
257
- .dropdown-menu-sm &,
258
- .menu-cascading & {
259
- padding: $menu-link-padding-cascading;
260
- }
312
+ &:disabled,
313
+ &.disabled {
314
+ background-color: transparent;
315
+ color: $menu-link-color-disabled;
316
+ pointer-events: none;
261
317
  }
262
318
 
263
- //
264
- // toggle
265
- //
266
- .dropdown-toggle,
267
- .menu-toggle {
268
- &::after {
269
- border-top: $caret-width solid;
270
- border-right: $caret-width solid transparent;
271
- border-left: $caret-width solid transparent;
272
- content: "";
273
- display: inline-block;
274
- height: 0;
275
- margin-left: $caret-width;
276
- position: relative;
277
- top: -1px;
278
- vertical-align: middle;
279
- width: 0;
280
- }
319
+ .dropdown-menu-sm &,
320
+ .menu-cascading & {
321
+ padding: $menu-link-padding-y-cascading $menu-link-padding-x-cascading;
322
+ }
323
+ }
281
324
 
282
- // active. focus, hover
283
- &:focus {
284
- outline: 0;
285
- }
325
+
326
+
327
+ // Divider
328
+
329
+ .dropdown-divider {
330
+ @include nav-divider($menu-divider-bg);
331
+ }
332
+
333
+
334
+
335
+ // Header
336
+
337
+ .dropdown-header {
338
+ color: $menu-header-color;
339
+ display: block;
340
+ font-size: $menu-font-size;
341
+ font-weight: bolder;
342
+ line-height: $menu-line-height;
343
+ margin: 0;
344
+ padding: $menu-link-padding-y $menu-link-padding-x;
345
+ white-space: nowrap;
346
+
347
+ .dropdown-menu-sm &,
348
+ .menu-cascading & {
349
+ font-size: $menu-font-size-cascading;
350
+ line-height: $menu-line-height-cascading;
351
+ padding: $menu-link-padding-y-cascading $menu-link-padding-x-cascading;
286
352
  }
353
+ }
287
354
 
288
- .dropup {
289
- .dropdown-toggle,
290
- .menu-toggle {
291
- &::after {
292
- border-top: 0;
293
- border-bottom: $caret-width solid;
294
- }
355
+
356
+
357
+ // Toggle
358
+
359
+ .dropdown-toggle {
360
+ &::after {
361
+ @include set-material-icons;
362
+
363
+ content: $caret-icon;
364
+ display: inline-block;
365
+ margin-right: ($caret-spacer-x * -1);
366
+ margin-left: $caret-spacer-x;
367
+
368
+ .dropup & {
369
+ content: $caret-icon-dropup;
295
370
  }
296
371
  }
372
+
373
+ &:empty::after {
374
+ margin-left: ($caret-spacer-x * -1);
375
+ }
376
+ }