Sass (Syntactically Awesome Stylesheet) is a css pre-processor, which helps to reduce


Download 1.88 Mb.
bet8/9
Sana18.02.2023
Hajmi1.88 Mb.
#1213853
1   2   3   4   5   6   7   8   9
Bog'liq
download-pdf-ebooks.org-1494878519Sl2H1

Welcome to Tutorialspoint

Welcome to Tutorialspoint

Welcome to Tutorialspoint
>This is line one with left padding 50.
>This is line two with left padding 40.
>This is line three with left padding 30.
>This is line four with left padding 20.
>This is line five with left padding 10.

Example using include



sample.htm




Next, create file sample.scss.



@mixin style {
.cont{
color: #77C1EF;
}
}
@include style;

sample.scss


You can tell SASS to watch the file and update the CSS whenever SASS file changes, by using the following command:

sass --watch C:\ruby\lib\sass\sample.scss:sample.css

Next, execute the above command; it will create the sample.css file automatically with the following code:





.cont {
color: #77C1EF;
}

sample.css




Output


Let us carry out the following steps to see how the above given code works:




Sass – Including a Mixin




Description


The @include directive is used to include the mixin in the document. The name of mixin is taken and optional arguments are passed into it. The styles defined by the mixin can be included into the current rule.


Example


The following example demonstrates the use of including a mixin in the SCSS file:





<a href="/basics-of-sass-colours-what-is-sass.html">Mixin example of sass</a>





Download 1.88 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling