Title: Feature request: Define CSS variables
Last modified: June 23, 2020

---

# Feature request: Define CSS variables

 *  Resolved [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/)
 * Hi Danny,
 * Would you consider outputing the font family names as CSS variables? Something
   like the following:
 *     ```
       function test_inline_styles() {
   
       	$body_font    = ogf_build_font_stack( get_theme_mod( 'ogf_body_font' ) );
       	$heading_font = ogf_build_font_stack( get_theme_mod( 'ogf_heading_font' ) );
   
       	$css =
       	'
       	:root {
       		--font-body: ' . esc_attr( $body_font ) . ';
       		--font-heading: ' . esc_attr( $heading_font ) . ';
       	}
       	';
   
       	wp_add_inline_style( 'child-style', wp_strip_all_tags( $css ) );
       }
       add_action( 'wp_enqueue_scripts', 'test_inline_styles' );
       ```
   
 * This way the theme can use these variables in custom places.
 * Thanks!
 * -Kathy

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [DannyCooper](https://wordpress.org/support/users/dannycooper/)
 * (@dannycooper)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13026402)
 * Hi Kathy (@helgatheviking),
 * That’s a fantastic suggestion, would you be interested in submitting a pull request?
 * [https://github.com/fontsplugin/plugin](https://github.com/fontsplugin/plugin)
 *  Thread Starter [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13026842)
 * Maybe!? I looked for you on github but couldn’t find the repo, but let me see
   what I can do.
 *  Plugin Author [DannyCooper](https://wordpress.org/support/users/dannycooper/)
 * (@dannycooper)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13026864)
 * Github repo is here – [https://github.com/fontsplugin/plugin](https://github.com/fontsplugin/plugin)
 *  Thread Starter [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13026934)
 * I meant I went looking for it before posting this initially. But sending a PR
   now.
 * Incoming!! 🙂
 *  Plugin Author [DannyCooper](https://wordpress.org/support/users/dannycooper/)
 * (@dannycooper)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13037956)
 * Merged in 2.0.6 and updated in 2.0.7.
 *  Plugin Author [DannyCooper](https://wordpress.org/support/users/dannycooper/)
 * (@dannycooper)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13160454)
 * Hi [@helgatheviking](https://wordpress.org/support/users/helgatheviking/),
 * Just a heads up, we changed the naming convention of CSS vars in 2.1.5 to a more
   widely used system – [https://github.com/fontsplugin/plugin/commit/0f82990f2e83954ca477b8d4eacd2a8541552327#diff-fd33a17ed5a9480340423e55debdc277](https://github.com/fontsplugin/plugin/commit/0f82990f2e83954ca477b8d4eacd2a8541552327#diff-fd33a17ed5a9480340423e55debdc277)
 *  Thread Starter [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13161503)
 * Thanks for the heads up!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Feature request: Define CSS variables’ is closed to new replies.

 * ![](https://ps.w.org/olympus-google-fonts/assets/icon-256x256.jpg?rev=2812012)
 * [Fonts Plugin | Google Fonts, Adobe Fonts & Upload Fonts](https://wordpress.org/plugins/olympus-google-fonts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/olympus-google-fonts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/olympus-google-fonts/)
 * [Active Topics](https://wordpress.org/support/plugin/olympus-google-fonts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/olympus-google-fonts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/olympus-google-fonts/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/feature-request-define-css-variables/#post-13161503)
 * Status: resolved