ASP.NET MVC layout templates are being treated as "partial files"
See original GitHub issueOriginal message
In a project that uses layouts in ASP.NET MVC, these files are partial for the framework, but are “normal” CSS files and, to use SASS in these scenario, it should be treated as a normal SCSS file.
Structure:
- Views
- Shared
- _Layout.cshtml
- _Layout.cshtml.css (to generate this file, the ideal scenario is that a file named _Layout.cshtml.scss could be generated in Live Sass extension)
- Shared
The reason for this to not work is because files starting with “_” are always treated as partial SCSS files.
There is a chance that if a file is in the pattern of “liveSassCompile.settings.includeItems” it could be processed even if the name starts with “_”? So I could explicit add a pattern (like /**/Views/**/_*.cshtml.scss
) to make this work. Or the default “liveSassCompile.settings.excludeList” could contain the pattern /**/_*.*
, so this behavior could be configured by the user “out-of-the-box” instead of being hardcoded.
Thanks in advance and congratulations for the great work!
Tasks
- Apply code changes
- Update documentation
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
I think that, for my use case, it should work, indeed.
For now, I just need to build some “partial” files (in this specific case, unfortunately, is not the reality, because this is more a conflict in conventions between SASS and ASP.NET that anything else 😄). So, with this new options, it should do the trick.
I think I will help testing it, then, when the new version comes out. 🧑🎄
Thanks for the help, @glenn2223. And congratz for the effort to maintain this project!
No problem. It’s also fine if you don’t feel you can contribute to the point. Do you feel this possible solution would work for you?
It’s not happened so far, but here’s hoping for change with some more ideas 🤞. Come on community, weigh in 😂
No need for a PR. I just like to share my thoughts and have the chance for feedback, rather than just implementing something that “should do the job”. If I don’t get any further feedback after a few days then I will implement the change myself.
I’m about to have a 2-week break from my uni studies, and a week off from work, so I should have the spare time to pop this in and push an alpha for you/people to try come the new year