mirror of
				https://github.com/mdbootstrap/mdb-ui-kit.git
				synced 2025-10-31 16:07:53 +03:00 
			
		
		
		
	Change togglebutton's first-child to first-of-type
This commit is contained in:
		
							parent
							
								
									c83d857a26
								
							
						
					
					
						commit
						a4a7911193
					
				|  | @ -1,6 +1,6 @@ | ||||||
| ## Playground | ## Playground | ||||||
| 
 | 
 | ||||||
| Use this pen to test and deveop new features of Material Design for Bootstrap: | Use this pen to test and develop new features of Material Design for Bootstrap: | ||||||
| 
 | 
 | ||||||
| http://codepen.io/FezVrasta/pen/ihmea | http://codepen.io/FezVrasta/pen/ihmea | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,13 +7,13 @@ | ||||||
|       font-weight: 400; |       font-weight: 400; | ||||||
|       cursor: pointer; |       cursor: pointer; | ||||||
|     // Hide original checkbox |     // Hide original checkbox | ||||||
|     input[type=checkbox]:first-child { |     input[type=checkbox]:first-of-type { | ||||||
|       opacity: 0; |       opacity: 0; | ||||||
|       width: 0; |       width: 0; | ||||||
|       height:0; |       height:0; | ||||||
|     } |     } | ||||||
|     // Switch bg on |     // Switch bg on | ||||||
|     input[type=checkbox]:first-child:checked + .toggle { |     input[type=checkbox]:first-of-type:checked + .toggle { | ||||||
|       background-color: rgba(0, 149, 135, 0.5); |       background-color: rgba(0, 149, 135, 0.5); | ||||||
|       // Handle on |       // Handle on | ||||||
|       &:after { |       &:after { | ||||||
|  | @ -22,7 +22,7 @@ | ||||||
|     } |     } | ||||||
|     // Switch bg off and disabled |     // Switch bg off and disabled | ||||||
|     .toggle, |     .toggle, | ||||||
|     input[type=checkbox][disabled]:first-child + .toggle { |     input[type=checkbox][disabled]:first-of-type + .toggle { | ||||||
|       content: ""; |       content: ""; | ||||||
|       display: inline-block; |       display: inline-block; | ||||||
|       width: 30px; |       width: 30px; | ||||||
|  | @ -48,20 +48,20 @@ | ||||||
|       transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease; |       transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease; | ||||||
|     } |     } | ||||||
|     // Handle disabled |     // Handle disabled | ||||||
|     input[type=checkbox][disabled]:first-child + .toggle:after, |     input[type=checkbox][disabled]:first-of-type + .toggle:after, | ||||||
|     input[type=checkbox][disabled]:checked:first-child + .toggle:after{ |     input[type=checkbox][disabled]:checked:first-of-type + .toggle:after{ | ||||||
|       background-color: #BDBDBD; |       background-color: #BDBDBD; | ||||||
|     } |     } | ||||||
|     // Ripple on |     // Ripple on | ||||||
|     input[type=checkbox]:first-child:checked ~ .toggle:active:after { |     input[type=checkbox]:first-of-type:checked ~ .toggle:active:after { | ||||||
|       box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4), 0 0 0 15px rgba(0, 149, 135, 0.1); |       box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4), 0 0 0 15px rgba(0, 149, 135, 0.1); | ||||||
|     } |     } | ||||||
|     // Ripple off and disabled |     // Ripple off and disabled | ||||||
|     input[type=checkbox]:first-child ~ .toggle:active:after, |     input[type=checkbox]:first-of-type ~ .toggle:active:after, | ||||||
|     input[type=checkbox][disabled]:first-child ~ .toggle:active:after { |     input[type=checkbox][disabled]:first-of-type ~ .toggle:active:after { | ||||||
|       box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4), 0 0 0 15px rgba(0, 0, 0, 0.1); |       box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4), 0 0 0 15px rgba(0, 0, 0, 0.1); | ||||||
|     } |     } | ||||||
|     input[type=checkbox]:first-child:checked + .toggle:after { |     input[type=checkbox]:first-of-type:checked + .toggle:after { | ||||||
|       left: 15px; |       left: 15px; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user