Skip to content

Nested selectors do not work if they are the only rule #109

Description

@Cedware

I have to Styled-Elements in my source code:

<Styled @bind-Classname="@hideBody">
    & .ant-card-body {
        display: none;
    }
</Styled>

<Styled @bind-Classname="@root" ComposeHideBody="@hideBody" ComposeHideBodyIf="@(!_edit)">
    margin: 5px;
</Styled>

If the field _edit is set to true, display: none should be applied to the descendant with the class name ant-card-body, which is not happening with the code above. But when I add another rule to the first Styled element it suddenly works as I expected it to:

<Styled @bind-Classname="@hideBody">
    color: red;
    & .ant-card-body {
        display: none;
    }
</Styled>

<Styled @bind-Classname="@root" ComposeHideBody="@hideBody" ComposeHideBodyIf="@(!_edit)">
    margin: 5px;
</Styled>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions