Skip to content

Commit

Permalink
Remove raw css imports
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Mar 24, 2018
1 parent cb7de6b commit 5d8be50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
8 changes: 0 additions & 8 deletions src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,6 @@ namespace Sass {
// process the resolved entry
else if (resolved.size() == 1) {
bool use_cache = c_importers.size() == 0;
if (resolved[0].deprecated) {
// emit deprecation warning when import resolves to a .css file
deprecated(
"Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass.",
"Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.",
true, pstate
);
}
// use cache for the resource loading
if (use_cache && sheets.count(resolved[0].abs_path)) return resolved[0];
// try to read the content of the resolved file entry
Expand Down
14 changes: 1 addition & 13 deletions src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ namespace Sass {
// (4) given + extension
// (5) given + _index.scss
// (6) given + _index.sass
std::vector<Include> resolve_includes(const std::string& root, const std::string& file, const std::vector<std::string>& exts, const std::vector<std::string>& d_exts)
std::vector<Include> resolve_includes(const std::string& root, const std::string& file, const std::vector<std::string>& exts)
{
std::string filename = join_paths(root, file);
// split the filename
Expand All @@ -353,18 +353,6 @@ namespace Sass {
abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
}
// next test d_exts plus underscore
for(auto ext : d_exts) {
rel_path = join_paths(base, "_" + name + ext);
abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path, true });
}
// next test plain name with d_exts
for(auto ext : d_exts) {
rel_path = join_paths(base, name + ext);
abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path, true });
}
// index files
if (includes.size() == 0) {
// ignore directories that look like @import'able filename
Expand Down
11 changes: 2 additions & 9 deletions src/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,9 @@ namespace Sass {
public:
// resolved absolute path
std::string abs_path;
// is a deprecated file type
bool deprecated;
public:
Include(const Importer& imp, std::string abs_path, bool deprecated)
: Importer(imp), abs_path(abs_path), deprecated(deprecated)
{ }
Include(const Importer& imp, std::string abs_path)
: Importer(imp), abs_path(abs_path), deprecated(false)
: Importer(imp), abs_path(abs_path)
{ }
};

Expand Down Expand Up @@ -127,11 +122,9 @@ namespace Sass {
namespace File {

static std::vector<std::string> defaultExtensions = { ".scss", ".sass" };
static std::vector<std::string> deprecatedExtensions = { ".css" };

std::vector<Include> resolve_includes(const std::string& root, const std::string& file,
const std::vector<std::string>& exts = defaultExtensions,
const std::vector<std::string>& d_exts = deprecatedExtensions);
const std::vector<std::string>& exts = defaultExtensions);

}

Expand Down

0 comments on commit 5d8be50

Please sign in to comment.