The theme I'm using makes extensive use of internal stylesheets to style various types of pages and their elements. For example, through their plugin UI, I can configure a specific page's hero layout and content... including font, size and color for various text elements. After configuring the hero and publishing the page, an internal stylesheet is added to the page's <head>
tag:
<style id="ut-hero-custom-css" type="text/css">
#ut-hero .hero-inner {
text-align: right
}
.hero-description {
color: #000000;
}
.hero-description {
background: #FCB54B;
padding-bottom: 0;
margin-bottom: 5px;
}
#ut-hero .hero-title {
color: #1777FF;
}
</style>
Unfortunately, the plugin is limited in what it allows me to customize so I need to add some of my own CSS to fine tune things. Let's say I want to display a border around the block of text with class="hero-description"
. I'd need to add
.hero-description {
border: 1px solid #c00;
}
and have it be applied to the page AFTER the initial declaration above. Adding it my child-theme's style.css file or any other CSS file I register and enqueue adds it BEFORE. I was hoping that I could specify the inline stylesheet embedded by the plugin as a dependency for my new CSS file when enqueueing it, but I don't see any handle or reference to it in $wp_styles so I couldn't do that. Can you even register an internal stylesheet?
Anyway, this can be broken down to a very general problem. I want to have the "last word" on the page's CSS (excluding inline styles and scoped elements). Is there not a direct way to specify that a line of code such as:
<link rel="stylesheet" src="mycss.css">
always be included right before the closing </head>
tag?