Skip to content

anyone think 【tag:before{&:hover{color:red}}】 should compiles to 【tag:hover:before{color:red}】? #1605

Closed
@xieranmaya

Description

@xieranmaya

I'm using LESS today and I wrote a LESS spinet like this:

div:before{
    content:'css generated content';
    color:green;
    &:hover{
        color:red;
    }
}

and it compiles to

div:before {
    content:'css generated content';
    color: green;
}
div:before:hover {
    color: red;
}

and this can't work, but it's intuitive....
you can see this question:
http://stackoverflow.com/questions/5777210/how-to-write-hover-condition-for-abefore-and-aafter

so, do you think that the above LESS code should compiles to

div:before {
    content:'css generated content';
    color: green;
}
div:hover:before {
    color: red;
}

and it's works in browser
which means

div:before{
    &:hover{
    }
}

should compile to

div:hover:before

mind the

:hover and :before
's order

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions