YogeshChauhan . com

The basics of @import rule in SCSS (Sass)

in SCSS on June 7, 2021

@import rule is not an invention from SassScript. It has actually derived the rule from CSS. Using the @import rule, you can import CSS and SCSS (Sass) files.

You can access the members (functions, variables and mixins) from another modules after you import those modules. Bunch of CSS files you want to combine? Use @import to do so.

The difference between CSS imports and SCSS (Sass) imports is that SCSS imports are handled completely during the compilation of the files while CSS imports require the browser to make multiple requests.

Syntax

CSS and SCSS imports have the same syntax. The advantage of SCSS imports is that you can import multiple files in a single import statement like this:


@import 'foundation/code', 'foundation/lists';

Note that you don’t need to use quotes while importing URLs in Sass (indented) syntax.

Sass will remove @import rules entirely in future. Use @use rule instead.

amazon

Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #3 How to add Read More Read Less Button using JavaScript? #4 How to uninstall Cocoapods from the Mac OS? #5 How to Use SQL MAX() Function with Dates? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

Jun 16 What are Stored Procedures for SQL Server? Jun 16 What are Class Constants in PHP? Jun 15 A short basic guide on states in React Jun 15 How to define constants in PHP? Jun 15 How to define visibility for a property in PHP? Jun 15 How to use @if and @else in SCSS?

You might also like these

What is the difference between float and double?MiscA complete diagram with building blocks of an Angular applicationAngularFor In Loop in Swift for BeginnersSwiftArray.from() Method in JavaScriptJavaScriptHow to create a new HTML element programmatically using JavaScript?HTMLHow to vertically align a html radio button to it’s label?CSSAggregate Functions Examples in Postgres for BeginnersPostgresHow to apply style to the first-child using jQuery?jQueryWordPress: How to get ACF field values from another post?WordPressHow to animate list items using CSS and JavaScript?CSSHow to create a flip pricing table using CSS and JavaScript?CSSHow to center an image horizontally and vertically?CSS