CSS file keeps changing

I have the following CSS in my main.css file:

 background-image:-moz-linear-gradient(top, #eeeeee, #aaaaaa) !important; background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#aaaaaa)) !important; background-image:-webkit-linear-gradient(top, #eeeeee, #aaaaaa) !important; background-image:-o-linear-gradient(top, #eeeeee, #aaaaaa) !important; background-image:linear-gradient(to bottom, #eeeeee, #aaaaaa) !important; background-repeat:repeat-x; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffaaaaaa', GradientType=0) !important; 

Which continues to change:

 background-image: linear-gradient(to bottom, #eeeeee, #aaaaaa) !important; 

Why can this happen? The .navbar .nav , which is also defined in another CSS file, the Bootstrap CSS file. Could it be that Visual Studio automatically clears duplicate definitions or something else?

edit: It changes every line. I can’t determine which action causes it to automatically change.

+4
source share
2 answers

These are browser based CSS tags:

This only works in mozilla:

 background-image:-moz-linear-gradient(top, #eeeeee, #aaaaaa) !important; 

Works in Chrome / Webkit-based browsers:

 background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#aaaaaa)) !important; background-image:-webkit-linear-gradient(top, #eeeeee, #aaaaaa) !important; 

In fact, this cross-browser technology is somewhat outdated in the CSS3 release. You need to find the appropriate CSS that works in the browser you are using.

It does not "change" exactly this, another browser is ignored by the browser.

+1
source

See if there are any build events settings in Visual Studio. Perhaps the project is configured to run something like csstidy or css minimizer, which is trying to clear duplicate properties.

Alternatively, if you use a control source (which I hope you are), your control source can be configured to trigger a commit hook that does the same. How to configure this will depend on the control you are using.

I would not expect this to be a problem with the modern version of csstidy (or any other modern CSS optimization tool, for that matter). However, if this is a project that you inherited, it may have been set up some time ago using a tool that is now deprecated.

0
source

Source: https://habr.com/ru/post/1490354/


All Articles