Parent Theme Development


Hi Guys, I am develoment parent them by using beans, I have included beans /lib folder to use beans library. How can I update beans style sheet? Can I update below .less files with developer mod enable?

\lib\api\uikit\src\less\core\form.less
\lib\api\uikit\src\less\core\button.less

\lib\assets\less\style.less
\lib\assets\less\default.less

\lib\assets\less\uikit-overwrite\article.less
\lib\assets\less\uikit-overwrite\base.less

Thanks,


Hi Usman,

No you should not update any files is the lib directory as it will be overwriten the next time an update comes up. What you should do is have your assets in your theme root (outside the lib directory) and enqueue as such from your theme functions.php:

/*
 * Remove this action and callback function if you do not whish to use LESS to style your site or overwrite UIkit variables.
 * If you are using LESS, make sure to enable development mode via the Admin->Appearance->Settings option. LESS will then be processed on the fly.
 */
add_action( 'beans_uikit_enqueue_scripts', 'example_uikit_assets' );
/**
 * Enqueue UIkit assets.
 */
function example_uikit_assets() {

  beans_compiler_add_fragment( 'uikit', get_template_directory_uri() . '/style.less', 'less' );

}

// Remove this action and callback function if you are not adding CSS in the style.css file.
add_action( 'wp_enqueue_scripts', 'example_enqueue_assets' );
/**
 * Enqueue assets.
 */
function example_enqueue_assets() {

  wp_enqueue_style( 'child-style', get_template_directory_uri() . '/style.css' );

}

Then snippet above shows you how to enqueue LESS file and/or a CSS file which you can should according to your project needs.

Happy coding,


Hi Thierry Muller,

Thanks a lot

I am getting very strange issue about cache. e.g

In google speed test it is showing that a8bece8.css is blocking CSS resources see below screenshot http://prntscr.com/f97xo1

But a8bece8.css is not my css my css file path 'beans/compiler/beans/09d821d.css'. It is showing in page source

Not sure from where it is getting a8bece8.css

Please advice

Thanks


Hi Usman,

The compiled files are situtated in the uploades/beans/compiler/beans/ directory (as it is on the screenshot you shared). Could you share a screenshot of you page source please (or a link to the site would be even better as screenshot doesn't help much to debug)?

Thanks,

Write a reply

Login or register to write a reply, it's free!