@@ -23,15 +23,18 @@ md-tree {
2323 transform : rotate (90deg );
2424 pointer-events : none ;
2525 }
26-
27- & + .checkbox-container .md-container {
28- margin-left : 0 ;
29- }
3026 }
3127
3228 & .md-open > .md-branch-inner > .md-branch-icon-container .md-branch-icon {
3329 transform : rotate (-90deg );
3430 }
31+
32+ // hide arrow icon if we are at the most nested level
33+ & .md-tip {
34+ .md-branch-icon {
35+ display : none ;
36+ }
37+ }
3538 }
3639}
3740
@@ -254,34 +257,23 @@ md-branch {
254257
255258
256259
257-
258- // --- MIXINS from ngMaterial ---
259-
260+ // Checkbox style
260261$select-option-padding : 16px !default ;
261262$checkbox-width : 20px !default ;
262263$checkbox-height : $checkbox-width !default ;
263264$checkbox-border-radius : 2px !default ;
264265$checkbox-border-width : 2px !default ;
265266
266- // This mixin allows a user to use the md-checkbox css outside of the
267- // md-checkbox directive.
268- // See src/components/select/select.scss for an example.
269- @mixin checkbox-container (
270- $checkedSelector : ' .md-checked' ,
271- $width : $checkbox-width ,
272- $height : $checkbox-height ,
273- $border-width : $checkbox-border-width ,
274- $border-radius : $checkbox-border-radius ) {
275- .md-container {
267+ // branch's checkbox
268+ md-branch .md-checkbox-enabled > .md-branch-inner {
269+ .checkbox-container {
276270 position : relative ;
277271 top : 50% ;
278272 box-sizing : border-box ;
279273 display : inline-block ;
280- width : $width ;
281- height : $height ;
282- @include rtl (left , 0 , auto );
283- @include rtl (right , auto , 0 );
284- margin : auto 24px ;
274+ width : $checkbox-width ;
275+ height : $checkbox-height ;
276+ margin : auto 24px auto 0 ;
285277
286278 & :before {
287279 box-sizing : border-box ;
@@ -308,93 +300,42 @@ $checkbox-border-width: 2px !default;
308300 bottom : -10px ;
309301 left : -10px ;
310302 }
311-
312- .md-ripple-container {
313- position : absolute ;
314- display : block ;
315- width : auto ;
316- height : auto ;
317- left : -15px ;
318- top : -15px ;
319- right : -15px ;
320- bottom : -15px ;
321- }
322303 }
323304
324305 // unchecked
325- .md -icon {
306+ .checkbox -icon {
326307 box-sizing : border-box ;
327308 transition : 240ms ;
328309 position : absolute ;
329310 top : 0 ;
330311 left : 0 ;
331- width : $width ;
332- height : $height ;
333- border-width : $border-width ;
312+ width : $checkbox- width ;
313+ height : $checkbox- height ;
314+ border-width : $checkbox- border-width ;
334315 border-style : solid ;
335- border-radius : $border-radius ;
316+ border-radius : $checkbox- border-radius ;
336317 }
318+ }
337319
338- & #{$checkedSelector } .md-icon {
320+ // branch's checkbox: SELECTED
321+ md-branch .md-checkbox-enabled [selected ] > .md-branch-inner {
322+ .checkbox-icon {
339323 border-color : transparent ;
340324
341325 & :after {
342326 box-sizing : border-box ;
343327 transform : rotate (45deg );
344328 position : absolute ;
345- left : $width / 3 - $border-width ;
346- top : $width / 9 - $border-width ;
329+ left : $checkbox- width / 3 - $checkbox- border-width ;
330+ top : $checkbox- width / 9 - $checkbox- border-width ;
347331 display : table ;
348- width : $width / 3 ;
349- height : $width * 2 / 3 ;
350- border-width : $border-width ;
332+ width : $checkbox- width / 3 ;
333+ height : $checkbox- width * 2 / 3 ;
334+ border-width : $checkbox- border-width ;
351335 border-style : solid ;
352336 border-top : 0 ;
353337 border-left : 0 ;
354338 content : ' ' ;
355339 }
356340 }
357-
358- // disabled
359- & [disabled ] {
360- cursor : default ;
361- }
362-
363- & .md-indeterminate .md-icon {
364- & :after {
365- box-sizing : border-box ;
366- position : absolute ;
367- top : 50% ;
368- left : 50% ;
369- transform : translate (-50% , -50% );
370- display : table ;
371- width : $width * 0.6 ;
372- height : $border-width ;
373- border-width : $border-width ;
374- border-style : solid ;
375- border-top : 0 ;
376- border-left : 0 ;
377- content : ' ' ;
378- }
379- }
380- }
381-
382-
383- @mixin rtl ($prop , $ltr-value , $rtl-value ) {
384- #{$prop } : $ltr-value ;
385- [dir = rtl ] & {
386- #{$prop } : $rtl-value ;
387- }
388- }
389-
390-
391- // Checkbox style
392- $select-option-padding : 16px !default ;
393- $checkbox-width : 20px !default ;
394- $checkbox-height : $checkbox-width !default ;
395- $checkbox-border-radius : 2px !default ;
396- $checkbox-border-width : 2px !default ;
397-
398- md-branch .md-checkbox-enabled {
399- @include checkbox-container (' [selected]' );
400341}
0 commit comments