wordpress - Unlimited Colour Schemes in wp theme for Zurb Foundation with reduxframework -


i developing wordpress theme zurb foundation 5 framework , reduxframework theme options panel. so, there various way can implement colour schemes wordpress theme.

  1. using different style sheets different colour schemes.
  2. using css class , id
  3. +many more way........

but, don't want way. reduxframework can dynamically change css files , write class or id. , want way. can modify foundation 5 css style sheet class , id reduxframework options panel dynamically. , after changing, it's must change theme colour schemes.

foundation 5 comes 6 main colour options. want change reduxframework options panel.

  1. primary color
  2. secondary color
  3. alert color
  4. success color
  5. body font color
  6. header font color

also there way can modify or change every options comes foundation 5 css framework redux framework.

please go image link. {open image in new tab bigger view}

http://i.stack.imgur.com/yi0ad.png 

now question is, how can things ?

i know short of php, js, html, css, mysql etc. if describe in answer, it's more helpful me.

this question re-posted unlimited colour schemes in wp theme foundation 5 - wordpress development stack exchange: . 1 reputed user suggested me ask question here!

the answer given @dovy right in basics. far know there no less version of foundation. need foundation's sass (scss) files , sass (php) compiler.

it seems redux has sass compiler built in too: redux , sass

  1. install foundation code, instance running bower install foundation in wordpress folder.
  2. install php sass compiler, see: http://leafo.net/scssphp/

now in redux config file add hook on save:

add_action('redux/options/' . $opt_name . '/saved',  "compile_sass"  ); 

also see: https://github.com/reduxframework/redux-framework/issues/533

and add compile_sass function config file (you can use compile action example, see: http://docs.reduxframework.com/core/advanced/integrating-a-compiler/):

function compile_sass($values) {     global $wp_filesystem;      $filename = dirname(__file__) . '/style.css';      if( empty( $wp_filesystem ) ) {         require_once( abspath .'/wp-admin/includes/file.php' );         wp_filesystem();     }      if( $wp_filesystem ) {     require "scssphp/scss.inc.php";     $scss = new scssc();     $scss->setimportpaths("bower_components/foundation/scss/");      // search `assets/stylesheets/mixins.scss'     $css = $scss->compile('$primary-color: '.$values['primary-color'].';     @import "foundation.scss"');          $wp_filesystem->put_contents(             $filename,             $css,             fs_chmod_file // predefined mode settings wp files         );     } } 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -