For example:
app.scss
@import url('orange.css');
@import 'navel.scss';
orange.css
.orange {
color: orange;
}
navel.scss
.navel {
@extend .orange;
}
In SASS if you add
@import "test.css";
or
@import url("test.css");
it is compiled to pure css @import
directive. Because the file has a .css
extension, the SASS preprocessor thinks that this is pure CSS and the code inside is not involved in the SASS language operations. In your example, if you try to extend .orange
you will get:
The selector ".orange" was not found.
Shortly: the extending is possible only if you use SASS files.
@extend is not possible by importing a CSS file. You have to
The downside to this is you would be left with duplication. Supposed this import is a 7000 line long CSS file (like bootstrap), then you are going to be in trouble
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With