当前位置: 首页>>代码示例>>PHP>>正文


PHP scssc::setVariables方法代码示例

本文整理汇总了PHP中scssc::setVariables方法的典型用法代码示例。如果您正苦于以下问题:PHP scssc::setVariables方法的具体用法?PHP scssc::setVariables怎么用?PHP scssc::setVariables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scssc的用法示例。


在下文中一共展示了scssc::setVariables方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run_compiler

 public function run_compiler($scss_dir, $sass_vars, $sass_import_file, $css_name, $compile_method = 'scss_formatter_nested')
 {
     require_once WPCSC_PLUGIN_DIR . '/scssphp/scss.inc.php';
     $scss = new scssc();
     $scss->setImportPaths($scss_dir);
     $scss->setFormatter($compile_method);
     $scss->setVariables($sass_vars);
     $new_css = $scss->compile($sass_import_file);
     /* Write the CSS to the Database */
     $wpcscOptions = get_option('wpcsc1208_option_settings');
     /* Sanitze the CSS before going into the Database
        Refer to this doc, http://wptavern.com/wordpress-theme-review-team-sets-new-guidelines-for-custom-css-boxes */
     $wpcscOptions['wpcsc_content'][$css_name] = wp_kses($new_css, array('\'', '\\"'));
     update_option('wpcsc1208_option_settings', $wpcscOptions);
 }
开发者ID:mread1208,项目名称:wordpress-customizer-sass-compiler,代码行数:15,代码来源:class-customizer-options.php

示例2: isset

     */
    $primarycolor = isset($_POST['customize_ajax_ref_color_styles']) ? $_POST['customize_ajax_ref_color_styles'] : get_theme_mod('primary_color', '#3CBEFE');
    // prove color
    if (!preg_match('/#([a-f0-9]{3}){1,2}\\b/i', $primarycolor)) {
        $primarycolor = '#3CBEFE';
    }
    /**
     * Theme CSS Active
     */
    $theme_css = isset($_POST['customize_ajax_ref_theme_styles']) ? intval($_POST['customize_ajax_ref_theme_styles']) : get_theme_mod('ref_theme_styles', 1);
    /**
     * Theme CSS Woo Active
     */
    $theme_css_woo = isset($_POST['customize_ajax_ref_wc_styles']) ? intval($_POST['customize_ajax_ref_wc_styles']) : get_theme_mod('ref_wc_styles', 1);
    $scss = new scssc();
    $scss->setVariables(array("primarycolor" => $primarycolor));
    $custom_css_theme = $custom_css_woo = '';
    $custom_css = $scss->compile('

						/********************************
						*   Color
						**********************************/
						a,
						.text-primary,
						.pagination > li > a, .pagination > li > span,
						.btn-primary .badge,
						.btn-link,
						.list-group-item.active > .badge, .nav-pills > .active > a > .badge,
						.panel-primary > .panel-heading .badge,
						.wpt-taxonomy-popular-show-hide, .wpt-repadd,
							{ color: $primarycolor; }
开发者ID:twelch555,项目名称:toolset-starter-child-ii,代码行数:31,代码来源:theme-customizer-css.php

示例3: compile_bootstrap_css

function compile_bootstrap_css()
{
    // Include the compiler class
    require_once TEMPLATEPATH . '/inc/scssphp/scss.inc.php';
    // Start new SCSS class
    $scss = new scssc();
    // Set the path where our SCSS files are located
    $scss->setImportPaths(TEMPLATEPATH . "/css/scss/");
    $scss->setFormatter('scss_formatter');
    // Get all colors from the customizer
    $cfColors = get_option('cf_colors');
    // Overwrite any SASS variable we want!
    $scss->setVariables($cfColors);
    // Run the compiler with the new variables
    $newCss = $scss->compile('
        @import "bootstrap.scss";
    ');
    //Find our current bootstrap file
    $cssFile = TEMPLATEPATH . '/css/bootstrap.min.css';
    $currentCss = file_get_contents($cssFile);
    // Overwrite default bootstrap css with the newly compiled CSS
    file_put_contents($cssFile, $newCss);
}
开发者ID:searsandrew,项目名称:centreforge,代码行数:23,代码来源:customizer.php


注:本文中的scssc::setVariables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。