|
18 | 18 | @mixin styles() {
|
19 | 19 | :host {
|
20 | 20 | display: inline-flex;
|
| 21 | + align-items: center; |
| 22 | + justify-content: center; |
21 | 23 | outline: none;
|
| 24 | + padding: 0 16px; |
| 25 | + position: relative; |
22 | 26 | -webkit-tap-highlight-color: transparent;
|
23 | 27 | vertical-align: middle;
|
24 | 28 | user-select: none;
|
| 29 | + font-family: var(--_label-text-font); |
| 30 | + font-size: var(--_label-text-size); |
| 31 | + line-height: var(--_label-text-line-height); |
| 32 | + font-weight: var(--_label-text-weight); |
| 33 | + color: var(--_label-text-color); |
| 34 | + z-index: 0; // Ensure this is a stacking context so the indicator displays |
25 | 35 |
|
26 | 36 | @include ripple.theme(
|
27 | 37 | (
|
|
45 | 55 | margin-bottom: calc(var(--_active-indicator-height) + 1px);
|
46 | 56 | }
|
47 | 57 |
|
48 |
| - .button { |
49 |
| - box-sizing: border-box; |
50 |
| - display: inline-flex; |
51 |
| - align-items: center; |
52 |
| - justify-content: center; |
53 |
| - vertical-align: middle; |
54 |
| - width: 100%; |
55 |
| - position: relative; |
56 |
| - padding: 0 16px; |
57 |
| - margin: 0; |
58 |
| - z-index: 0; // Ensure this is a stacking context so the indicator displays |
59 |
| - font-family: var(--_label-text-font); |
60 |
| - font-size: var(--_label-text-size); |
61 |
| - line-height: var(--_label-text-line-height); |
62 |
| - font-weight: var(--_label-text-weight); |
63 |
| - color: var(--_label-text-color); |
64 |
| - } |
65 |
| - |
66 | 58 | .button::before {
|
67 | 59 | background: var(--_container-color);
|
68 | 60 | content: '';
|
|
105 | 97 | }
|
106 | 98 |
|
107 | 99 | // unselected states
|
108 |
| - .button ::slotted([slot='icon']) { |
| 100 | + ::slotted([slot='icon']) { |
109 | 101 | display: inline-flex;
|
110 | 102 | position: relative;
|
111 | 103 | writing-mode: horizontal-tb;
|
|
116 | 108 | height: var(--_icon-size);
|
117 | 109 | }
|
118 | 110 |
|
119 |
| - .button:hover { |
| 111 | + :host(:hover) { |
120 | 112 | color: var(--_hover-label-text-color);
|
121 | 113 | cursor: pointer;
|
122 | 114 | }
|
123 | 115 |
|
124 |
| - .button:hover ::slotted([slot='icon']) { |
| 116 | + :host(:hover) ::slotted([slot='icon']) { |
125 | 117 | color: var(--_hover-icon-color);
|
126 | 118 | }
|
127 | 119 |
|
128 |
| - .button:focus { |
| 120 | + :host(:focus) { |
129 | 121 | color: var(--_focus-label-text-color);
|
130 | 122 | }
|
131 | 123 |
|
132 |
| - .button:focus ::slotted([slot='icon']) { |
| 124 | + :host(:focus) ::slotted([slot='icon']) { |
133 | 125 | color: var(--_focus-icon-color);
|
134 | 126 | }
|
135 | 127 |
|
136 |
| - .button:active { |
| 128 | + :host(:active) { |
137 | 129 | color: var(--_pressed-label-text-color);
|
138 |
| - outline: none; |
139 | 130 | }
|
140 | 131 |
|
141 |
| - .button:active ::slotted([slot='icon']) { |
| 132 | + :host(:active) ::slotted([slot='icon']) { |
142 | 133 | color: var(--_pressed-icon-color);
|
143 | 134 | }
|
144 | 135 |
|
145 | 136 | // selected styling
|
146 | 137 | :host([active]) .indicator {
|
147 | 138 | opacity: 1;
|
148 | 139 | }
|
149 |
| - :host([active]) .button { |
| 140 | + :host([active]) { |
150 | 141 | color: var(--_active-label-text-color);
|
151 | 142 | @include elevation.theme(
|
152 | 143 | (
|
|
164 | 155 | );
|
165 | 156 | }
|
166 | 157 |
|
167 |
| - :host([active]) .button ::slotted([slot='icon']) { |
| 158 | + :host([active]) ::slotted([slot='icon']) { |
168 | 159 | color: var(--_active-icon-color);
|
169 | 160 | }
|
170 | 161 |
|
171 | 162 | // selected states
|
172 |
| - :host([active]) .button:hover { |
| 163 | + :host([active]:hover) { |
173 | 164 | color: var(--_active-hover-label-text-color);
|
174 | 165 | }
|
175 | 166 |
|
176 |
| - :host([active]) .button:hover ::slotted([slot='icon']) { |
| 167 | + :host([active]:hover) ::slotted([slot='icon']) { |
177 | 168 | color: var(--_active-hover-icon-color);
|
178 | 169 | }
|
179 | 170 |
|
180 |
| - :host([active]) .button:focus { |
| 171 | + :host([active]:focus) { |
181 | 172 | color: var(--_active-focus-label-text-color);
|
182 | 173 | }
|
183 | 174 |
|
184 |
| - :host([active]) .button:focus ::slotted([slot='icon']) { |
| 175 | + :host([active]:focus) ::slotted([slot='icon']) { |
185 | 176 | color: var(--_active-focus-icon-color);
|
186 | 177 | }
|
187 | 178 |
|
188 |
| - :host([active]) .button:active { |
| 179 | + :host([active]:active) { |
189 | 180 | color: var(--_active-pressed-label-text-color);
|
190 | 181 | }
|
191 | 182 |
|
192 |
| - :host([active]) .button:active ::slotted([slot='icon']) { |
| 183 | + :host([active]:active) ::slotted([slot='icon']) { |
193 | 184 | color: var(--_active-pressed-icon-color);
|
194 | 185 | }
|
195 | 186 |
|
|
0 commit comments