Skip to content

LESS Compile Error with Animation Keyframe Mixin #81

@someyoungideas

Description

@someyoungideas

So I recently found a great way to create mixin for animations using LESS and attempted in WE 2012. I was unable to get the file to compile unfortunately. It seems to be having issues with the @arguments being passed into the .keyframes. Allowing variables with @keyframes was allowed in LESS starting v1.7.0, https://github.com/less/less.js/blob/master/CHANGELOG.md. Here is my code

.whywouldyoudothis {
    .keyframes(blink;
        {
            0% { background: #fff; }
            100% { background: #000; }
        });

    .animation(blink 1s ease inifinite alternate);
}

.keyframes(@name; @arguments) {
    @-moz-keyframes @name { @arguments(); }
    @-webkit-keyframes @name { @arguments(); }
    @-o-keyframes @name { @arguments(); }
    @keyframes @name { @arguments(); }
}

.animation(@arguments) {
    -webkit-animation: @arguments;
    -moz-animation: @arguments;
    animation: @arguments;
}

And here is the compile error
LESS: Unrecognised input

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