Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Using variables in @imported file #352

@indreksiitan

Description

@indreksiitan

I'm trying to include SemanticUI's LESS in my project and failing. They include their theme.config file, which sets a @themesFolder variable and then does @import "theme.less", which in turn tries to use the variable in another import: @import "@{themesFolder}/default/globals/site.variables", but fails stating that @themesFolder is not set.

So far, I've traced this down to:

Less_Tree_Import::ParseImport() imports theme.config and does:
$root = $parser->parseFile($full_path, $uri, true);
$ruleset = new Less_Tree_Ruleset(array(), $root->rules );

After that, the variable exists in $ruleset. It then calls:
$ruleset->evalImports($import_env);

Function evalImports($env) iterates through $this->rules and if the rule is an import, then calls:
$rules = $rule->compile($env);

Now, since the received $env is passed, what happens is that the variables defined in this particular ruleset up to the import are not available.

Am I on the right tracks? Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions