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.
- using different style sheets different colour schemes.
- using css class , id
- +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.
- primary color
- secondary color
- alert color
- success color
- body font color
- 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
- install foundation code, instance running
bower install foundationin wordpress folder. - 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
Post a Comment