A group of mixins, functions and variables to get your frontend project started.
npm install starlette-sass-helpers
Include the following "import" in your sass files.
@import "path/to/your/node_modules/starlette-sass-helpers/scss/lilium";
Remember to change out "path/to/your/" to match your folder structure.
For example, if your sass file is located at "/assets/sass/layout.scss" then the code would change to this:
@import "../../node_modules/starlette-sass-helpers/scss/lilium";
body {
@include breakpoint(sm) {
color: green;
}
@include breakpoint(sm, max) {
color: blue;
}
@include breakpoint(sm, between) {
color: red;
}
@include breakpoint(lg, between) {
color: black;
}
}
The above code compiles to this
@media(min-width: 576px) {
body {
color: green;
}
}
@media(max-width: 575px) {
body {
color: blue;
}
}
@media(min-width: 576px)and (max-width: 767px) {
body {
color: red;
}
}
@media(min-width: 992px)and (max-width: 1199px) {
body {
color: #000;
}
}
See how flexbox works.
body {
@include flexbox;
@include flex-direction( col );
}
Mixin | Param 1 | Param 2 |
---|---|---|
font-size | Mobile font size | Desktop font size |
As the screen size changes the font size will change accordingly. This all happens between the mobile and desktop breakpoints.
When it hits the mobile breakpoint it will stay a fixed size (example below - 16px). Same goes for desktop (example below - 35px).
The responsive size will never be smaller than the mobile font size or bigger than the desktop font size.
h1 {
// 16px - mobile font size
// 35px - desktop font size
@include font-size( 16px, 35px );
}
Direction | Colors |
---|---|
down / up / right / left | List of colors (space separated) |
body {
@include linear-gradient( down, red orange yellow green blue purple pink );
}
h1 {
@include text-background-gradient( left, rgba(255,255,255,0) #444444 );
}
Uses a 24 grid column structure.
col-1
is the smallest size column (4.16%).
<div class="container">
<div class="row">
<div class="col-1"> 1 </div>
<div class="col-2"> 2 </div>
<div class="col-3"> 3 </div>
<div class="col-4"> 4 </div>
<div class="col-5"> 5 </div>
<div class="col-6"> 6 </div>
<div class="col-7"> 7 </div>
<div class="col-8"> 8 </div>
<div class="col-9"> 9 </div>
<div class="col-10"> 10 </div>
<div class="col-11"> 11 </div>
<div class="col-12"> 12 </div>
<div class="col-13"> 13 </div>
<div class="col-14"> 14 </div>
<div class="col-15"> 15 </div>
<div class="col-16"> 16 </div>
<div class="col-17"> 17 </div>
<div class="col-18"> 18 </div>
<div class="col-19"> 19 </div>
<div class="col-20"> 20 </div>
<div class="col-21"> 21 </div>
<div class="col-22"> 22 </div>
<div class="col-23"> 23 </div>
<div class="col-24"> 24 </div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-1"> </div>
<div class="col-md-1"> </div>
<div class="col-lg-1"> </div>
<div class="col-xl-1"> </div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-1"> </div>
<div class="offset-col-1"> </div>
</div>
</div>