Skip to content

[Blazor Wasm] css isolation not wokring. #28626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TanvirArjel opened this issue Dec 13, 2020 · 1 comment
Closed

[Blazor Wasm] css isolation not wokring. #28626

TanvirArjel opened this issue Dec 13, 2020 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components feature-css-isolation This issue is related to CSS Isolation feature ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved

Comments

@TanvirArjel
Copy link
Contributor

I have two layouts as follows:

  1. MainLayout
  2. AdminLayout

CSS file for MainLayout.razor is MainLayout.razor.css as follows:

body {
    margin-top: 58px;
}

CSS file for AdminLayout.razor is AdminLayout.razor.css as follows:

body {
    margin-top: 0px !important;
}

None of the styles is applied when the respective layout page is rendered.

@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components feature-css-isolation This issue is related to CSS Isolation feature labels Dec 14, 2020
@mkArtakMSFT
Copy link
Member

Thanks for contacting us.
Per documentation, the elements the styles are targeting should be part of the components to be rendered. In your example, you're trying to style parent element, which is not something supported by the current CSS Isolation feature.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Dec 14, 2020
@ghost ghost added the Status: Resolved label Dec 14, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-css-isolation This issue is related to CSS Isolation feature ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants