55//
66// ^^ defined in variables.scss
77//
8- $checkbox-margin : 16px !default ;
9- $checkbox-text-margin : 10px !default ;
10- $checkbox-top : 12px !default ;
8+ $checkbox-margin : 3px !default ;
9+ $checkbox-margin-end : 16px !default ;
1110
12- .md-inline-form {
13- md-checkbox {
14- margin : 19px 0 18px ;
15- }
16- }
11+
12+ // md-spacing values (horizontal spacing with icons)
13+ // normal = 36px (Angular Material default)
14+ // wide = 48px (Material Design Spec dense)
15+ // extra-wide = 56px (Material Design Spec default)
16+
17+ $checkbox-text-margin : 36px !default ;
18+ $checkbox-text-margin-wide : 48px !default ;
19+ $checkbox-text-margin-extra-wide : 56px !default ;
1720
1821md-checkbox {
1922 box-sizing : border-box ;
2023 display : inline-block ;
21- margin-bottom : $checkbox-margin ;
24+ margin : $checkbox-margin ;
2225 white-space : nowrap ;
2326 cursor : pointer ;
2427 outline : none ;
2528 user-select : none ;
2629 position : relative ;
2730 min-width : $checkbox-width ;
28- min-height : $checkbox-width ;
29- @include rtl (margin-left , 0 , $checkbox-margin );
30- @include rtl (margin-right , $checkbox-margin , 0 );
31-
32- & :last-of-type {
33- margin-left : 0 ;
34- margin-right : 0 ;
35- }
31+ min-height : $checkbox-width * 2 ;
32+ margin-left : $checkbox-margin ;
33+ margin-right : $checkbox-margin ;
3634
3735 & .md-focused :not ([disabled ]) {
3836 ._md-container :before {
@@ -49,22 +47,60 @@ md-checkbox {
4947 }
5048 }
5149
52- & .md-align-top-left > div ._md-container {
53- top : $checkbox-top ;
54- }
55-
5650 @include checkbox-container ;
5751
52+ ._md-container {
53+ top : $checkbox-height ;
54+ }
55+
5856 ._md-label {
5957 box-sizing : border-box ;
6058 position : relative ;
6159 display : inline-block ;
6260 vertical-align : middle ;
6361 white-space : normal ;
6462 user-select : text ;
63+ margin-top : 6px ;
64+ margin-bottom : 6px ;
65+
66+ @include rtl (margin-left , $checkbox-text-margin - $checkbox-margin , 0 );
67+ @include rtl (margin-right , 0 , $checkbox-text-margin - $checkbox-margin );
68+
69+ & :empty {
70+ display : none ;
71+ }
72+
73+ }
74+
75+ & [md-spacing = " wide" ]{
76+ ._md-label {
77+ @include rtl (margin-left , $checkbox-text-margin-wide - $checkbox-margin , 0 );
78+ @include rtl (margin-right , 0 , $checkbox-text-margin-wide - $checkbox-margin );
79+ }
80+ }
6581
66- @include rtl (margin-left , $checkbox-text-margin + $checkbox-width , 0 );
67- @include rtl (margin-right , 0 , $checkbox-text-margin + $checkbox-width );
82+ & [md-spacing = " extra-wide" ]{
83+ ._md-label {
84+ @include rtl (margin-left , $checkbox-text-margin-extra-wide - $checkbox-margin , 0 );
85+ @include rtl (margin-right , 0 , $checkbox-text-margin-extra-wide - $checkbox-margin );
86+ }
87+ }
88+ }
89+
90+
91+ .layout-row ,
92+ .layout-xs-row , .layout-gt-xs-row ,
93+ .layout-sm-row , .layout-gt-sm-row ,
94+ .layout-md-row , .layout-gt-md-row ,
95+ .layout-lg-row , .layout-gt-lg-row ,
96+ .layout-xl-row {
97+ & > md-checkbox :not (:last-child ), {
98+ @include rtl (margin-left , $checkbox-margin , $checkbox-margin-end );
99+ @include rtl (margin-right , $checkbox-margin-end , $checkbox-margin );
100+ }
68101
102+ .md-inline-form & > md-checkbox {
103+ margin-top : 19px ;
104+ margin-bottom : auto ;
69105 }
70106}
0 commit comments