Skip to content

Commit

Permalink
Improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadosh committed Aug 5, 2016
1 parent 61d0e5e commit 32f4b00
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
8 changes: 4 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function wp_dynamic_css_set_callback( $handle, $callback )
/**
* Clear the cached compiled CSS for the given handle.
*
* Initially, registered dynamic stylesheets are compiled and stored in cache.
* Subsequesnt requests are served statically from cache until
* wp_dynamic_css_clear_cache() is called and clears it, forcing the compiler
* to recompile the CSS.
* Registered dynamic stylesheets that have the $cache flag set to true are
* compiled only once and then stored in cache. Subsequesnt requests are
* served statically from cache until wp_dynamic_css_clear_cache() is called
* and clears it, forcing the compiler to recompile the CSS.
*
* @param string $handle The name of the stylesheet to be cleared from cache
*/
Expand Down
25 changes: 20 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: Askupa Software, ykadosh
Tags: dynamic css, css, customizer, get_theme_mod, css variables, css compiler
Requires at least: 3.0
Tested up to: 4.5.1
Stable tag: 1.0.4
Tested up to: 4.5.3
Stable tag: 1.0.5
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -31,7 +31,7 @@ wp_dynamic_css_enqueue( 'my_dynamic_style', 'path/to/my-style.css' );
// 3. Set the callback function (used to convert variables to actual values)
function my_dynamic_css_callback( $var_name )
{
return get_theme_mod($var_name);
return get_theme_mod($var_name);
}
wp_dynamic_css_set_callback( 'my_dynamic_style', 'my_dynamic_css_callback' );

Expand All @@ -42,7 +42,7 @@ Then, create a file called `my-style.css` and write this in it:

<pre>
body {
background-color: $body_bg_color;
background-color: $body_bg_color;
}
</pre>

Expand All @@ -52,7 +52,16 @@ Now, let's say that <code>get_theme_mod('body_bg_color')</code> returns the valu

<pre>
body {
background-color: #fff;
background-color: #fff;
}
</pre>

There's even support for array subscripts and piped filters:

<pre>
body {
background-color: $myVar['index'];
color: $myVar|myFilter;
}
</pre>

Expand All @@ -70,6 +79,12 @@ Please follow the instructions on the plugin's [GitHub page](https://github.com/

== Changelog ==

= 1.0.5 =
* (NEW) Added support for cache
* (NEW) Added support for piped filters
* (FIX) Separated enqueued stylesheets
* (FIX) Increased priority of enqueued stylesheets to override static stylesheets

= 1.0.4 =
* (FIX) Set cache-control to no-cache so that changes to options are reflected immediately
* (NEW) Added support for CSS minification
Expand Down

0 comments on commit 32f4b00

Please sign in to comment.