Skip to content

Links created from NavLink are not styled from css isolation file #27434

@gregoryagu

Description

@gregoryagu

Describe the bug

Links created from NavLink are not styled from css isolation file

To Reproduce

Create a new Blazor Server App.

Add this html to index:

<p>
    <NavLink href="http://microsoft.com">Test Link Which is not styled from index.razor.css as it should be</NavLink>
</p>

<p>
    <a href="http:/microsoft.com">Test link which IS styled correctly</a>
</p>

Create Index.razor.css and add this style:

a{
    color: aqua
}

Run the app. The first one is incorrectly styled, the second one is correctly style.

This is the generated HTML:

<a href="http://microsoft.com">Test Link Which is not styled from index.razor.css as it should be</a>

<a href="http:/microsoft.com" b-bb2jwcaddy>Test link which IS styled correctly</a>

Note that the first one does not have b-bb2jwcaddy. If this is added, then it is correctly styled.

I am using VS 16.8.0 Preview 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions