mirror of
				https://github.com/mdbootstrap/mdb-ui-kit.git
				synced 2025-10-31 16:07:53 +03:00 
			
		
		
		
	altered conversion of shadows as mixins (incorrectly saw them as @extends)
This commit is contained in:
		
							parent
							
								
									4ebb1c4596
								
							
						
					
					
						commit
						6958131c31
					
				
							
								
								
									
										14
									
								
								Gruntfile.js
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Gruntfile.js
									
									
									
									
									
								
							|  | @ -17,16 +17,18 @@ module.exports = function (grunt) { | ||||||
|         }], |         }], | ||||||
|         options: { |         options: { | ||||||
|           replacements: [ |           replacements: [ | ||||||
|             // bad conversions of shadow-z-* to @include instead of @extend
 | 
 | ||||||
|             { // https://regex101.com/r/bF2iJ2/1
 | 
 | ||||||
|               pattern: /@include shadow-z-(\d+)((?:-hover)?)\(\);/gi, |             // convert all shadow mixins
 | ||||||
|               replacement: '@extend .shadow-z-$1$2;', |             { // https://regex101.com/r/sJ2lH4/1
 | ||||||
|  |               pattern: /.shadow-z-(\d+)((?:-hover)?) {/gi, | ||||||
|  |               replacement: '@mixin shadow-z-$1$2 {', | ||||||
|               order: 2 |               order: 2 | ||||||
|             }, |             }, | ||||||
|             // bad conversions of .shadow-z-*
 |             // bad conversions of .shadow-z-*
 | ||||||
|             { // https://regex101.com/r/pV0yB0/2
 |             { // https://regex101.com/r/pV0yB0/3
 | ||||||
|               pattern: /\.shadow-z-(\d+)((?:-hover)?)(?:\(\))?;/gi, |               pattern: /\.shadow-z-(\d+)((?:-hover)?)(?:\(\))?;/gi, | ||||||
|               replacement: '@extend .shadow-z-$1$2;', |               replacement: '@include shadow-z-$1$2;', | ||||||
|               order: 2 |               order: 2 | ||||||
|             }, |             }, | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| @mixin btn-shadow(){ | @mixin btn-shadow(){ | ||||||
|   @extend .shadow-z-1; |   @include shadow-z-1(); | ||||||
|   transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); |   transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); | ||||||
|   &:active:not(.btn-link) { |   &:active:not(.btn-link) { | ||||||
|     @extend .shadow-z-1-hover; |     @include shadow-z-1-hover(); | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -18,10 +18,10 @@ | ||||||
|   color: $darkbg-text; |   color: $darkbg-text; | ||||||
| 
 | 
 | ||||||
|   &:hover:not(.btn-link):not(.btn-flat):not(.btn-fab) { |   &:hover:not(.btn-link):not(.btn-flat):not(.btn-fab) { | ||||||
|     @extend .shadow-z-1; |     @include shadow-z-1(); | ||||||
|   } |   } | ||||||
|   &:active:not(.btn-link):not(.btn-flat):not(.btn-fab) { |   &:active:not(.btn-link):not(.btn-flat):not(.btn-fab) { | ||||||
|     @extend .shadow-z-1-hover; |     @include shadow-z-1-hover(); | ||||||
|   } |   } | ||||||
|   transition: background-color 0.2s ease, box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); |   transition: background-color 0.2s ease, box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); | ||||||
|   outline: none !important; |   outline: none !important; | ||||||
|  | @ -75,10 +75,10 @@ | ||||||
|       @include variations(unquote(""), background-color, transparent); |       @include variations(unquote(""), background-color, transparent); | ||||||
|     } |     } | ||||||
|     &, &:hover { |     &, &:hover { | ||||||
|       @extend .shadow-z-1; |       @include shadow-z-1(); | ||||||
|     } |     } | ||||||
|     &:active { |     &:active { | ||||||
|       @extend .shadow-z-1-hover; |       @include shadow-z-1-hover(); | ||||||
|     } |     } | ||||||
|     &, .ripple-wrapper { |     &, .ripple-wrapper { | ||||||
|       border-radius: 100%; |       border-radius: 100%; | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ | ||||||
|     color: $card-body-text; |     color: $card-body-text; | ||||||
|     background: $card-body-background; |     background: $card-body-background; | ||||||
| 
 | 
 | ||||||
|     @extend .shadow-z-2; |     @include shadow-z-2(); | ||||||
| 
 | 
 | ||||||
|     .card-image { |     .card-image { | ||||||
|         height: 60%; |         height: 60%; | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
| // Material Design element Dialogs | // Material Design element Dialogs | ||||||
| // -------------------------------------------------- | // -------------------------------------------------- | ||||||
| .modal-content { | .modal-content { | ||||||
|   @extend .shadow-z-5; |   @include shadow-z-5(); | ||||||
|   border-radius: 2px; |   border-radius: 2px; | ||||||
|   border: none; |   border: none; | ||||||
|   // Modal header |   // Modal header | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
|   border: 0; |   border: 0; | ||||||
| 
 | 
 | ||||||
|   @include variations(unquote(" > .panel-heading"), background-color, $grey-200); |   @include variations(unquote(" > .panel-heading"), background-color, $grey-200); | ||||||
|   @extend .shadow-z-1; |   @include shadow-z-1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,7 +7,7 @@ | ||||||
|     color: $darkbg-text; |     color: $darkbg-text; | ||||||
|     font-size: 14px; |     font-size: 14px; | ||||||
|     border-radius: 2px; |     border-radius: 2px; | ||||||
|     @extend .shadow-z-1; |     @include shadow-z-1; | ||||||
| 
 | 
 | ||||||
|     // Animation |     // Animation | ||||||
|     height: 0; |     height: 0; | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
|   background: $popover-background; |   background: $popover-background; | ||||||
|   border: none; |   border: none; | ||||||
|   border-radius: $material-border-radius; |   border-radius: $material-border-radius; | ||||||
|   @extend .shadow-z-1; |   @include shadow-z-1(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .tooltip, .tooltip.in { | .tooltip, .tooltip.in { | ||||||
|  |  | ||||||
|  | @ -1,34 +1,34 @@ | ||||||
| .shadow-z-1 { | @mixin shadow-z-1 { | ||||||
|   box-shadow: |   box-shadow: | ||||||
|     0 1px 6px 0 rgba(0, 0, 0, 0.12), |     0 1px 6px 0 rgba(0, 0, 0, 0.12), | ||||||
|     0 1px  6px 0 rgba(0, 0, 0, 0.12); |     0 1px  6px 0 rgba(0, 0, 0, 0.12); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .shadow-z-1-hover { | @mixin shadow-z-1-hover { | ||||||
|   box-shadow: |   box-shadow: | ||||||
|     0 5px 11px 0 rgba(0, 0, 0, 0.18), |     0 5px 11px 0 rgba(0, 0, 0, 0.18), | ||||||
|     0 4px 15px 0 rgba(0, 0, 0, 0.15); |     0 4px 15px 0 rgba(0, 0, 0, 0.15); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .shadow-z-2 { | @mixin shadow-z-2 { | ||||||
|   box-shadow: |   box-shadow: | ||||||
|     0 8px 17px 0 rgba(0, 0, 0, 0.2), |     0 8px 17px 0 rgba(0, 0, 0, 0.2), | ||||||
|     0 6px 20px 0 rgba(0, 0, 0, 0.19); |     0 6px 20px 0 rgba(0, 0, 0, 0.19); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .shadow-z-3 { | @mixin shadow-z-3 { | ||||||
|   box-shadow: |   box-shadow: | ||||||
|     0 12px 15px 0 rgba(0, 0, 0, 0.24), |     0 12px 15px 0 rgba(0, 0, 0, 0.24), | ||||||
|     0 17px 50px 0 rgba(0, 0, 0, 0.19); |     0 17px 50px 0 rgba(0, 0, 0, 0.19); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .shadow-z-4 { | @mixin shadow-z-4 { | ||||||
|   box-shadow: |   box-shadow: | ||||||
|     0 16px 28px 0 rgba(0, 0, 0, 0.22), |     0 16px 28px 0 rgba(0, 0, 0, 0.22), | ||||||
|     0 25px 55px 0 rgba(0, 0, 0, 0.21); |     0 25px 55px 0 rgba(0, 0, 0, 0.21); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .shadow-z-5 { | @mixin shadow-z-5 { | ||||||
|   box-shadow: |   box-shadow: | ||||||
|     0 27px 24px 0 rgba(0, 0, 0, 0.2), |     0 27px 24px 0 rgba(0, 0, 0, 0.2), | ||||||
|     0 40px 77px 0 rgba(0, 0, 0, 0.22); |     0 40px 77px 0 rgba(0, 0, 0, 0.22); | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ body, .container, .container-fluid { | ||||||
|     background-color: #fff; |     background-color: #fff; | ||||||
|     padding: 19px; |     padding: 19px; | ||||||
|     margin-bottom: 20px; |     margin-bottom: 20px; | ||||||
|     @extend .shadow-z-2; |     @include shadow-z-2(); | ||||||
|     border-radius: 2px; |     border-radius: 2px; | ||||||
|     border: 0; |     border: 0; | ||||||
|     p { |     p { | ||||||
|  |  | ||||||
|  | @ -2,6 +2,7 @@ | ||||||
| @import '_variables'; | @import '_variables'; | ||||||
| @import '_mixins'; | @import '_mixins'; | ||||||
| @import '_icons-material-design'; | @import '_icons-material-design'; | ||||||
|  | @import '_shadows'; // these are mixins only, and must be placed at the top before use (sass requiremnt) | ||||||
| 
 | 
 | ||||||
| body { | body { | ||||||
|   background-color: $body-bg; |   background-color: $body-bg; | ||||||
|  | @ -136,7 +137,3 @@ legend { | ||||||
| @import '_plugin-nouislider'; | @import '_plugin-nouislider'; | ||||||
| @import '_plugin-selectize'; | @import '_plugin-selectize'; | ||||||
| @import '_plugin-dropdownjs'; | @import '_plugin-dropdownjs'; | ||||||
| 
 |  | ||||||
| // Material shadows |  | ||||||
| // Place them on bottom of stylesheet to increase the importance of it and override other same-specificity selectors |  | ||||||
| @import '_shadows'; |  | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user