0
I’m making a mixin in Less and need to use @import passing a variable as parameter.
Example:
change-Theme.Less
.change-theme(@theme) {
@import @theme;
// Another code goes here
}
Theme.Less
@import "change-theme";
.theme-black {
.change-theme("variables/my_black_theme");
}
.theme-green {
.change-theme("variables/my_green_theme");
}
It does not accept variable in parameter, there is some way to do this?
Error:
{ [Error: malformed import statement in file change-Theme.Less line no. 6] type: 'Syntax', filename: 'change-Theme.Less', index: 124, line: 6, callLine: Nan, callExtract: Undefined, column: 2, Extract: [ ', ' @import @Theme;', '' ], message: 'malformed import statement in file change-Theme.Less line no. 6', stack: Undefined, lineNumber: 6, filename: 'change-Theme.Less', name: 'Error', showStack: a false, showProperties: true, plugin: 'Gulp-Less', __Safety: { toString: [Function] } }
Tag as response ^^.
– Allan Ramos