If you are going to enqueue a stylesheet you should be using wp_enqueue_scripts not wp_print_styles, but you are in a bit of a gray zone between doing things “WordPress-ie” and doing things correctly for performance.
The “WordPress-ie” way is to enqueue a stylesheet, but from a performance standpoint you are loading an additional resource and in your case you also have to boot a significant portion of the WordPress Core to populate that dynamic stylesheet.
I would not do that. If it were me I would echo <style tags into the head. By doing so, you avoid loading an additional resource and you also avoid loading the WordPress twice. This is what the WordPress Core itself does with dynamic CSS created by, for example, the Theme Customization API.
The only case where I would consider loading another dynamic stylesheet would be if you have an enormous amount of CSS to load. I doubt you do.
Related Posts:
- str_replace inside specific css files [closed]
- How to get the Date Format and Time Format settings for use in my template?
- Where are Additional CSS files stored
- Is it ever okay to include inline CSS in plugins?
- How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)
- How to include own css on wordpress tinymce editor?
- How to customize the default HTML for WordPress Attachments
- Is it possible to change the attributes of a registered style or script before it fires?
- FireFox Inspector :: find CSS file related to
- Custom editor field displaying HTML in Visual editor
- Custom CSS for full post vs. excerpt (Content Options)
- On Install, which code sets the ‘home’ option?
- wp_enqueue_style with style.php and WordPress functions
- Style reset password page? /wp-login.php?action=rp
- How to get WordPress to accept the tag in articles (or other alternatives)
- Custom widget select options needs to stay selected after save
- What will happen to the additional CSS when the theme is updated?
- How to display post title & excerpt when mouse hovers on an image?
- Cannot figure out how to center div in WordPress theme [closed]
- Customizing default Mediaelement player
- how can I change the background color of all posts on my server?
- CSS to remove “comments count” icon from main page [closed]
- how to add custom css and js on wordpress post editor directly without using .php file
- TwentyFifteen: How can it show a different color on every post page?
- Warning: Creating default object… when altering Customize panels
- WordPress slugs and 404 handling takes preference over folders in site root?
- What changes we need to make to a theme so it can be installed as a MU Theme?
- Is it possible to add a ribbon in the background of h1 on every page?
- Resizing of a header/div in a website through css in wordpress [closed]
- Child theme .css files are not overriding their parent .css files
- Child Theme with multiple css files
- CSS Customizations for certain page
- Redirect to another page using contact form 7? [closed]
- Custom CSS at Appearance > Edit CSS is missing after update [closed]
- CSS Styling a specific page
- How to remove footer from just homepage
- Why the css in twenteenfourteen-child theme take no effect?
- How to format text of site subtitle
- how to add custom logo to my template
- WordPress noob, assign custom stylesheet using @import or if? Didn’t work for me
- Good way to customize admin CSS?
- css media query question [closed]
- How to customize the WordPress 2014 theme, to have page using less horizontal margin?
- Remove header title form page through CSS [closed]
- Centering one product on a single page [closed]
- custom css and javascript not working on page defined as template?
- WordPress menu: How to make www.link.com/#name never contain current_page_item class?
- How to add Custom Css within the Editor?
- Will WordPress updates remove Gutenberg Additional Classes?
- Custom CSS Nav Menu Style Not Being Applied
- custom email validation using javascript api with elementor pro and code snippets
- How do I make mysite.com/comingsoon WordPress to become my main website’s WordPress?
- Style WooCommerce Product Search Widget
- why won’t my custom css load with the enqueue method or any other method?
- Use Theme CSS in custom code
- Changing the CSS with a plugin
- CSS style and app.js not loading
- How can I style the Comment Section of a blog post
- How do I make elements in mobile only reverse order?
- How to style bootstrap container in WordPress?
- how to add custom html and css to wordpress
- How can I delete the word `Category:` from page titles? [duplicate]
- How to have different background image based on post category
- How replace theme styles?
- Wrap WordPress Login Form in custom Div
- How do I target this page specifically?
- How do I change the content of an element for a theme without losing the styling?
- I can’t override CSS
- Two color in one Heading
- WordPress Inline Style missing
- Style Radio Buttons inside Edit Page (Custom Fields)
- Adding separate CSS files for separate pages with functions.php
- How to echo custom styles in css format?
- Edit a custom admin page
- Special characters showing in fallback font
- How to support extra color options for shortcodes?
- how to register / add multiple options into one field in wordpress?
- Custom options – register, defaults and delete empty fields (Settings API)
- How to delete orphan userdata from array in wp-options
- retrieve theme custom settings
- What is Global WordPress Objects?
- Adding css and js to a blank page created with custom template
- Will too many overridden css rules lead to performance issues
- Complete Custom Style Part of Site
- add custom css on all page exept of one
- Making custom pages (with an example to explain the goal)
- Custom CSS File wont work on second Page
- how can i change the html and the css of my word press theme that I bought?
- responsive screen not working [closed]
- Edit image alignment in WordPress twentysixteen child theme on attachment page [closed]
- adding new html css to wordpress section from codepen [closed]
- How do I add custom CSS animations for specific Gutenberg blocks?
- Particle.js not loading in WordPress Gutenberg
- Cannot add custom css in site
- Post interior margin in twenty eleven theme
- Modifying posts based on category in TwentyTwentyTwo theme
- How to display product variations on same row
- Add custom styles to the Raft theme
- Where did I put this one line of css?
- Hover Hide-Visible Additional CSS not working in WordPress website, but shows properly in Customize window