custom css in 4.60

2 weeks ago
Question: where to put custom stylesheet so the it overrides all the others? The canonical answer: `NopHtml.AppendCssFileParts("~/mytheme/my.css");` doesn't actually do it: only some of our custom stuff overrides the parent theme (? -- or whatever), not all of it.

In 4.40 my predecessor added `<link rel="stylesheet" href="@Url.Content("~/mytheme.my.css")" />` after `@NopHtml.GenerateCssFiles()` presumably to defeat that -- that's no longer working in 4.60.

So: what do people do to make sure their styles apply? Add your own custom class to every element on every page in your theme (or maybe just to the <body>)? Read the content of your stylesheet into <head> so it takes precedence for being "internal"? Something else I'm not thinking of?

TIA
1 week ago
Hello,

If you want to change everything in the CSS, it would be better to create your own theme.
You can see how to do that here.
https://docs.nopcommerce.com/en/developer/design/new-theme.html

Best regards
1 week ago
It is in our own theme, and upon closer inspection it looks like `NopHtml.AppendCssFileParts("~/Themes/mytheme/Content/css/custom-user-styles.css");` does work as advertised, it's just that a) 4.60 is not rendering the same way: there are paddings hat weren't there before and b) our web people have been making changes to CSS on production platform that they neglected to commit back to git.

I.e. it looks like a false alarm, apologies for the noise.