I am developing an application for various content management systems where I am unaware of the surrounding CSS and its selectors, yet I want my app to maintain a consistent appearance.
An issue I am facing is when an external selector targets one of my elements, such as button{height: 100px;}
, and my selector button .class{width:100px;}
does not specify the height
attribute. In this case, the external selector adds this attribute to my buttons, altering their style.
This is just a basic example. You may suggest specifying the height
in my selector as well, but I cannot include every possible attribute in my selectors to override any existing styles that may have been applied elsewhere.
You can view an example in this fiddle: https://jsfiddle.net/u4rvx6Lk/. Here, I do not want the first selector to apply border styling to my blue element, but it does so anyway.
I have attempted using all: unset;
and all: initial;
, but these solutions do not work reliably across all browsers, especially Internet Explorer.
I am also aware of scoped CSS, but I have found it to be inconsistent in resolving this issue.
(Additional Information: This is an Angular 1.x application that will primarily be integrated into WordPress CMS pages, and I compile my CSS using Sass.)