Search code examples
htmlcssgoogle-apps-scriptadd-on

Creating your own add-on to replace the CSS style on the site


Good day, guys. In an attempt to create my own browser add-on, I ran into the problem of partially replacing the CSS style for a certain site. In manifest.json says "css": ["styles.css"], when I try to launch the extension and refresh the page on the site I need, I see that the CSS style is not fully loaded, to be more precise, there are no fonts, some backgrounds, button colors. That is, some part of the CSS style is loaded, and some is not. What could be the problem?

I tried to change the "permissions", divided the CSS file into two parts, copied settings from other working extensions. Despite the fact that everything works fine in them.


Solution

  • The site's CSS may possibly have higher priority than your CSS. Try using !important.

    Example:

    width: 100px !important;