Reputation: 51
I'm using standard bootstrap with ASP .Net C# and it seems to be generating a lot of files like _navbar.scss. These work fine on localhost in both IE and Chrome. When I publish, it works in Chrome, but in IE none of the styles are being applied. I unfortunately have to code to IE as our standard.
I could understand it not working in IE both locally and in deployment, that would just be an issue with IE not complying with basic standards, but it does work on IE locally. I could understand it not working in production, that would likely indicate that something wasn't being copied over or something. I can't understand why it would work in production, and work in IE, but not specifically IE while in production.
Upvotes: 0
Views: 1402
Reputation: 1637
The standard template does not generate .scss (Sass) files. It actually returns a standard .css file. The reason when debugging in chrome it shows .scss files is because of a source map which sort of deconstructs the .css file to tell you where in the .sass files that created it where the code originates.
You can read about source maps here
And find out more about Sass here
The default template in _layout.cshtml has something like the following :
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
crossorigin="anonymous"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"/>
</environment>
What This Means:
You can read more about the Environment tag helper here
Bootstrap only supports IE10+ so if you are trying to use an older version of IE that will be your issue. See here
If you do use polyfills to get it working with older versions of IE, IE still has some quirks to watch out for. For one if using additional style sheets IE 6-9 had a maximum number of rules they could deal with before freaking out, which you may easily exceed. See here
If it is IE 10+ try and:
Hope that helps.
Upvotes: 1