[英]How i can add shared css between two Blazor Project?
I have two projects, one with MAUI, and another Blazor, do i have any chance to share one common css file between these two projects?我有两个项目,一个是 MAUI,另一个是 Blazor,我有机会在这两个项目之间共享一个通用的 css 文件吗?
I already tried to add this to the shared project, but the problem, it's, I cannot get any access to it, from the launched project, because I don`t have it in www root.我已经尝试将它添加到共享项目中,但问题是,我无法从启动的项目中访问它,因为我没有它在 www root 中。
The link to the CSS file must be - <link src="_content/{ExternalLibrary}/{name}.css"></link>
- Where {ExternalLibrary}
it is the name of the Shared library, and {name}
it`s the name of CSS file, which styles we want to import. CSS 文件的链接必须是 -
<link src="_content/{ExternalLibrary}/{name}.css"></link>
- {ExternalLibrary}
是共享库的名称, {name}
是`s CSS文件的名称,我们要导入的样式。 Also, this library must be a Razor class library.此外,此库必须是 Razor 类库。
I think you need a bundle to reuse static files such as js, css etc.我认为你需要一个包来重用静态文件,如 js、css 等。
Check this article https://www.syncfusion.com/faq/blazor/general/how-do-you-bundle-and-minify-the-css-and-js-files-in-blazor-applications查看这篇文章https://www.syncfusion.com/faq/blazor/general/how-do-you-bundle-and-minify-the-css-and-js-files-in-blazor-applications
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.