Skip to content
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

Add .cshtml.css styles in default project templates #31030

Closed
mkArtakMSFT opened this issue Mar 18, 2021 · 7 comments
Closed

Add .cshtml.css styles in default project templates #31030

mkArtakMSFT opened this issue Mar 18, 2021 · 7 comments
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-css-isolation This issue is related to CSS Isolation feature feature-templates
Milestone

Comments

@mkArtakMSFT
Copy link
Member

This will help with adoption of CSS Isolation.

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-css-isolation This issue is related to CSS Isolation feature labels Mar 18, 2021
@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone Mar 18, 2021
@ghost
Copy link

ghost commented Mar 18, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@captainsafia
Copy link
Member

I took a stab at doing this when I was fixing an scoped CSS issue in #31257 but it induced a ton of flakiness in the build.

In particular, our template tests do a validation where they check to see if the static assets requested by an app are received. For some reason, the generated CSS file from the scoped CSS throws a 404 sometimes.

Expected /AspNet._1rfblykoltv.styles.css to have status 'OK' but it was 'NotFound'.
Expected: True
Actual:   False
at Templates.Test.Helpers.AspNetProcess.AssertStatusCode(String requestUrl, HttpStatusCode statusCode, String acceptContentType) in /_/src/ProjectTemplates/Shared/AspNetProcess.cs:line 256
   at Templates.Test.Helpers.AspNetProcess.ContainsLinks(Page page) in /_/src/ProjectTemplates/Shared/AspNetProcess.cs:line 138
   at Templates.Test.Helpers.AspNetProcess.AssertPagesOk(IEnumerable`1 pages) in /_/src/ProjectTemplates/Shared/AspNetProcess.cs:line 117
   at Templates.Test.MvcTemplateTest.MvcTemplateCore(String languageOverride) in /_/src/ProjectTemplates/test/MvcTemplateTest.cs:line 108
   at Templates.Test.MvcTemplateTest.MvcTemplate_NoAuthCSharp() in /_/src/ProjectTemplates/test/MvcTemplateTest.cs:line 44
--- End of stack trace from previous location ---

https://dev.azure.com/dnceng/public/_build/results?buildId=1064596&view=ms.vss-test-web.build-test-results-tab&runId=32774366&resultId=123661

If we pursue this work, we'll probably need to get to the bottom of this.

As a sidenote: while working on the scoped CSS issue I was able to verify that it generally works as expected.

@javiercn
Copy link
Member

@captainsafia I suspect this is because the check /AspNet._1rfblykoltv.styles.css might not match the actual file scoped CSS generates. I think it is fine to skip this file if you want on the test to avoid the flakyness.

@captainsafia
Copy link
Member

Ah I see. I guess we'll have to add a way to exempt that particular file here:

foreach (IHtmlLinkElement styleSheet in html.GetElementsByTagName("link"))

@ghost
Copy link

ghost commented Apr 20, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT
Copy link
Member Author

@captainsafia I assume this is now done, isn't it?

@captainsafia
Copy link
Member

Yep! Not sure why it didn't close when I merged the PR.

@ghost ghost added Done This issue has been fixed and removed Working labels Sep 9, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-css-isolation This issue is related to CSS Isolation feature feature-templates
Projects
None yet
Development

No branches or pull requests

3 participants