If you’re wanting styles to be dynamic, then you’ll have to emit your CSS file as you are suggesting. However, as WordPress often uses styles.css as a theme definition file, renaming styles.php might cause problems.
It might be better to collect all the ‘dynamic’ definitions into a separate file (eg dynamic-styles.php) and import them from your main style.css file via @import(url),
Related Posts:
- Organizing Code in your WordPress Theme's functions.php File?
- What are the standard admin CSS id/class tags?
- adding custom stylesheet to wp-admin
- Admin Page Redirect
- Disable dragging of meta boxes?
- How to remove screen options and help links in the admin area?
- Sort admin menu items
- Custom column for changing post status via ajax
- Make fonts.com font work in TinyMCE (iframe referrer issue)
- How to remove items from +New admin menu?
- Make sub menu items a main link in the admin menu using fuctions.php
- Add column to pages table
- Admin account only shows Profile and Dashboard with no activity
- Can initial focus be set to search field in WordPress Media Library?
- How to wrap admin menus and menu headers in additional divs without modifying the WordPress core?
- wp-admin – save options without refreshing?
- WordPress wp-admin suddenly lost its style
- Activating Child Theme Breaks Website, Blank Page, Error 500
- How to prevent parent admin page from appearring as a child admin page
- Get Stylesheet To Showup in WP Admin Panel Editor
- Custom Background-Image not showing up
- Change WP-Login or WP-Admin
- SSL Partially breaking admin panel and elementor
- Why are my frontend theme styles bleeding into the backend?
- What is the practical difference between is_admin() and is_blog_admin()?
- How do I set the homepage to the WordPress Admin Dashboard login?
- Create a admin page in wordpress without admin menus (“wordpress sidebars”)
- How to hide wordpress default description box?
- I want to disable login of admin (/wp-admin) with email and make it accessible only with username
- Allow administrators to pick post author on custom post type edit screen
- How to make the front-end RTL without changing the admin panel language?
- In editor-style.css how can I change background color of title field?
- Can’t call external stylesheet for WordPress admin (using wp_admin_css)?
- Add column to pages table
- List All Enqueued Scripts and Styles
- How to apply a CSS file to my admin pages?
- What are the requirements to make the admin toolbar show up on the front end
- Remove bulk option row
- How to replace “Password Protected” text with icon in Admin
- Hooks: admin_footer and admin_print_footer_scripts not working?
- Can’t access wp-admin, redirects to http://%24domain/wp-admin/
- What is the correct way to get only display plugin for Administrator Only
- Admin top level menu, pointing to an external url
- Browse Happy in 3.2
- How to break line / add to ADMIN menu
- Add styles to wordpress admin on the Page List
- External HTTP API calls slowing down WordPress admin [closed]
- Outputting something based on the presence of post variable in admin screens
- Creating custom admin panel pages without making a plugin?
- Dashboard : remove Safari navigator message
- WordPress Child theme fails to override parent theme css
- Available resources for learning WordPress 4.7.2 from the ground up?
- CSS of the admin panel
- Uncaught SyntaxError: Unexpected Token Illegal
- Newly created user role not displaying on users screen
- WordPress Admin extremely slow when other admin logged in
- WordPress Admin Panel Left Sidebar No showing on Post create page
- Accessing wordpress tool in local MAMP Site
- How to remove Google fonts from wp-admin (Roboto) added by core
- Trying to login to my site redirects me to the first page
- Admin Login Checks
- Failed to load resource: the server responded with a status of 431 ()
- Why does my edit screen suddenly have such a buggy interface?
- When installing wordpress through WP CLI mysite.com/admin not working
- Admin area is not loading properly
- Trying to list user and post information from (wp_includes/post.php ) causes Fatal error
- Localhost install: Administrator lost administrator access; cannot access Dashboard
- Admin Login page not working at all
- CSS not showing up in my website Only HTML Displaying
- Change height of Add New Post input box
- Removing Author name
- theme injecting css into wp-admin
- Where are the Parent themes CSS & PHP files hidden on WordPress?
- Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- Override WordPress Core File?
- How to make the Panel // WP-Admin lighter via Mobile
- How to disable the “Post Lock/Edit Lock”?
- Highlight custom widgets in the admin area?
- Hide a page in the admin end without a plugin?
- Prevent from deleting any user role but subscriber
- Prevent Admin gui output from page added using add_submenu_page
- remove_action with profile_personal_options
- In the WordPress admin, how can I find out which page (themes.php, widgets.php, etc.) I’m on?
- Is it possible to edit the styling of the admin panel from within a custom theme?
- Enqueue and Dequeue from admin bar nodes
- Fixed layout for admin section
- How to display site title with post title?
- Remove WP Admin Menu Items by User Role
- Our Team not showing on website [closed]
- Get current session in WP admin
- Add logo to admin menu in my plugin
- How to remove the Login Customizer menu from the WordPress dashboard
- How to add a field on the user creation page?
- Login redirect_to url is pointing to a url with the port
- Text editor toolbar z-index conflict with location plugin pop
- Conditions for admin get_current_screen action parent_file edit.php?post_type=page
- Hook into backbone to add js to wp-admin -> media library?
- is_admin() conditional statement
- React Material UI and WordPress Admin Area