Title: Get css value with php
Last modified: October 6, 2023

---

# Get css value with php

 *  Anonymous User
 * (@anonymized-20809429)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/get-css-value-with-php/)
 * Hello everyone,
 * I’m trying to build an automation that sets a color based on already existing
   color set in “Customization”.
 * Is there a build-in WordPress function or a php function to get a css value and
   use it in code?
 * Example 
   echo get_css_value(accent_color); result “#453245”

Viewing 1 replies (of 1 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/get-css-value-with-php/#post-17106336)
 * No, there is no such function. How could there be: PHP runs on the server side
   while CSS is used in the browser. I would recommend you to look for another way.
   If it’s about a property that is set in the customizer, it’s surely somewhere
   in the database and you can access it via PHP.

Viewing 1 replies (of 1 total)

The topic ‘Get css value with php’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [wordpress function](https://wordpress.org/support/topic-tag/wordpress-function/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/get-css-value-with-php/#post-17106336)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
