Hello,
I would like to know what you consider to the best method for adding CSS ID’s to major body areas that cannot be ID tagged directly via Elementor.
Example: The Header & Footer
In the XStore HTML code these are referenced as:
For the Header:
<header data-elementor-type="header" data-elementor-id="193274" class="elementor elementor-193274 elementor-location-header" data-elementor-post-type="elementor_library">
For the Footer:
<footer data-elementor-type="footer" data-elementor-id="193271" class="elementor elementor-193271 elementor-location-footer" data-elementor-post-type="elementor_library">
I can reference these in my Child Theme Global CSS as:
.elementor-location-header .container-area .element {}
.elementor-location-footer .container-area .element {}
But that is very inefficient, and the CSS strings become unnecessarily long and complicated.
It also means that the DOM model will crawl the entire page’s 1000’s of lines of code to find the Header or Footer before applying styles, for each… and every… single… element.
In an ideal world, and for best page loading of targeted styles,
these would be so much referenced as:
#header .container-area .element {}
#footer .container-area .element {}
OR Perhaps Better as:
#masthead .container-area .element {}
#colophon .container-area .element {}
CSS styles apply instantly when referenced by CSS ID,
due to the DOM Model’s inherent use of getElementbyID().
Please Advise:
Other than adding XStore Theme Template files to my Child Theme and editing them directly there, is there any other, better way built in XStore that I do not yet know of?
BTW: The same question applies to the central page content area itself.
.template-container .page-wrapper .page-heading {}
.template-container .page-wrapper .container {}
These are all just inefficient and verbose CSS Element style prefixes.
How can I quickly and easily add CSS ID tags to major page areas, without having to copy XStore Template PHP files into my Child Theme, and then risk losing access to future code changes or functionality applied to the XStore theme itself?
FYI: I do realize that one could use jQuery to add those tags onPageLoad().
But even that relies on an initial full-crawl of thousands of lines of code to add 2 or 3 tags, BEFORE any of my custom CSS styles will be applied efficiently.
Thank You