I want to use a static css to reset my theme css, i cant modify main files because its paid theme and it will be auto reset at time of update.
So I need to add a static css just before (head close) so it could reset all top css.
I know how to add by : default_head_blocks.xml but that is adding css at the top of .
i want to use it like this js example:
<referenceContainer name="before.body.end">
<block class="Magento\Framework\View\Element\Js\Components" name="js.beforebody" as="jsbeforebody" template="Magento_Theme::js/js.phtml"/>
</referenceContainer>
1 Answer 1
I deal this case like this: Write your custom CSS in a custom.css -file and load this file normally in the head.
All classes you want to override can be overwritten on this way:
bought.css:
.class {
color: red
}
the !important -element is overwriting an existing definition.
custom.css:
.class {
color: blue !important;
}
or
body div.class {
color: blue;
}
The more specific you call the css the higher the chance to overwrite.