I have completed the necessary steps to integrate Bootstrap 5 SASS into my ASPNET Core project.
- To begin, I right-clicked on the
wwwroot
directory and selectedAdd->Client-Side Library
. From there, I chose the unpkg provider and added the
library.<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="80e2efeff4f3f4f2e1f0c0b5aeb1aeb3">[email protected]</a>
- Next, I created a new file named
main.scss
. - I then imported certain elements from
bootstrap
into the main.scss file for configuration.
The contents of the main.scss
file include:
@import "../lib/bootstrap/scss/bootstrap";
- After saving the main.scss file, I right-clicked it and selected
Web Compiler->Compile
. This action successfully compiled the file, resulting in the generation of bothmain.min.css
andmain.css
. - At this point, I updated the
_Layout.cshtml
file by adding
.<link href="~/css/main.css" rel="stylesheet" />
Despite these efforts, when loading the pages, the CSS appears to be malfunctioning. Specific classes like bg-dark
or bg-light
are displaying invalid values for the background-color
.
https://i.sstatic.net/XnPeJ.png
Furthermore, within Visual Studio, there are a total of 75 warnings stemming from the same main.css
file.