Skip to content

Commit

Permalink
CSS: Utilities for sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
sajjadarashhh authored and ScarletKuro committed Jul 20, 2023
1 parent 594cbf9 commit f75b87e
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MudBlazor/Styles/utilities/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

@import 'flexbox';

@import 'sizing';
@import 'text';

@import 'interactivity/cursor';
@import 'interactivity/pointerevents';

Expand Down
10 changes: 10 additions & 0 deletions src/MudBlazor/Styles/utilities/sizing/_height.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

@mixin height($breakpoint) {
@each $precessor in ("","max-","min-") {
@each $name,$value in ( "auto": auto,"25":25%,"50":50%,"75":75%,"100":100%,"25vh":25vh,"50vh":50vh,"75vh":75vh,"100vh":100vh ) {
.h-#{$precessor}#{$breakpoint}#{$name} {
#{$precessor}height: #{$value} !important;
}
}
}
}
12 changes: 12 additions & 0 deletions src/MudBlazor/Styles/utilities/sizing/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import '../../abstracts/variables';
@import '_height.scss';
@import '_width.scss';

@include height("");
@include width("");
@each $name, $value in $breakpoints-css-utilities-only {
@media (min-width:$value) {
@include height($name+'-');
@include width($name+'-');
}
}
9 changes: 9 additions & 0 deletions src/MudBlazor/Styles/utilities/sizing/_width.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@mixin width($breakpoint) {
@each $precessor in ("","max-","min-") {
@each $name,$value in ( "auto": auto,"25":25%,"50":50%,"75":75%,"100":100%,"25vw":25vw,"50vw":50vw,"75vw":75vw,"100vw":100vw ) {
.w-#{$precessor}#{$breakpoint}#{$name} {
#{$precessor}width: #{$value} !important;
}
}
}
}
9 changes: 9 additions & 0 deletions src/MudBlazor/Styles/utilities/text/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '../../abstracts/variables';
@import 'text-align.scss';

@include textAlign("");
@each $name, $value in $breakpoints-css-utilities-only {
@media (min-width:$value) {
@include textAlign($name+'-');
}
}
7 changes: 7 additions & 0 deletions src/MudBlazor/Styles/utilities/text/text-align.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@mixin textAlign($breakpoint) {
@each $name in ( center,end,start,left,right,justify,justify-all,match-parent ) {
.text-#{$breakpoint}#{$name} {
text-align: $name !important;
}
}
}

0 comments on commit f75b87e

Please sign in to comment.