Created
April 10, 2022 09:52
-
-
Save arunkumr/b97869a1a3fabf70f0022b96acee8b9a to your computer and use it in GitHub Desktop.
Less Scripts that i frequently use as part of my projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Sample Usage: | |
@import "grid.less"; | |
.gauge | |
{ | |
.make-grid(@sm,1,4); --Used for Responsive Styles | |
.make-grid(1,2); --Used for Non-Responsive Styles that can be used with Older Browsers and Mobile Screens. | |
} | |
*/ | |
@sm: 768px;@md: 992px;@lg: 1200px; | |
.grid { | |
display: inline-block; | |
*display: inline; | |
zoom: 1; | |
letter-spacing: normal; | |
word-spacing: normal; | |
vertical-align: top; | |
text-rendering: auto; | |
} | |
.row { | |
letter-spacing: -.31em; | |
text-rendering: optimizespeed; | |
font-family: FreeSans, Arimo, "Droid Sans", Helvetica, Arial, sans-serif; | |
-webkit-flex-flow: row wrap; | |
display: -ms-flexbox; | |
-ms-flex-flow: row wrap; | |
-ms-align-content: flex-start; | |
-webkit-align-content: flex-start; | |
align-content: flex-start; | |
margin: 0 -15px; | |
} | |
.row>div { | |
padding: 0 15px; | |
} | |
.grid-cal( @grid-len, | |
@total-len) { | |
@width: unit(((@grid-len/@total-len)*100), ~"%"); | |
} | |
.make-grid(@grid-len, | |
@total-len) { | |
&:extend(.grid); | |
.grid-cal(@grid-len, @total-len); | |
width: @width; | |
*width: @width; | |
} | |
.make-grid(@sw, | |
@grid-len, | |
@total-len) { | |
.make-grid(1, 1); | |
@media (min-width: @sw) { | |
.grid-cal(@grid-len, @total-len); | |
width: @width; | |
*width: @width; | |
} | |
} | |
.make-row() { | |
&:extend(.row); | |
& { | |
>div { | |
&:extend(.row>div); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment