output css using the Sass processor
327807
def render_css(self, fn=None, text=None, margin='', indent='\t'):
        """"""
        fn = fn or os.path.splitext(self.fn)[0]+'.css'
        if not os.path.exists(os.path.dirname(fn)):
            os.makedirs(os.path.dirname(fn))
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(fn))               # needed in order for scss to relative @import
        text = text or self.render_styles()
        if text != '': text = sass.compile(string=text)
        os.chdir(curdir)
        return CSS(fn=fn, text=text)
615512
function sassifyFn(rawObject) {
  var sassified = '';

  Object.keys(rawObject).forEach(function iterateVariables(key) {
    var variable = rawObject[key];

    var stringified = JSON.stringify(variable);

    // Trim off double quotes for CSS variables.
    stringified = stringified.substring(1, stringified.length - 1);

    sassified += '$' + key + ': ' + stringified + ';\n';
  });

  return sassified;
}
1202345
function copyCss() {
  return gulp.src(['./src/assets/stylesheets/*.css'], {base: './src/assets/stylesheets'})
    .pipe(gulp.dest(function (file) {
      return libraryDist + '/dist/css' + file.base.slice(__dirname.length); // save directly to dist
    }));
}
321518
function gulpSassMonster (opts = {}, sync = false) {
	/**
	 * Read buffer and transform
	 * @param {Buffer} file
	 * @param {...*} args
	 */
	function readBuffer (file, ...args) {
		let cb = args[1];
		let notSupported = notSupportedFile(file, pluginError, {
			silent: true
		});

		if (Array.isArray(notSupported)) {
			let status = notSupported.shift();
			if (status === 'isEmpty') {
				file.extname = '.css';
				return cb(null, file);
			}
			return cb(notSupported[0], notSupported[1]);
		}

		// get render options;
		const options = setupOptions(opts, file);

		if (sync) {
			try {
				let result = sass.renderSync(options);
				pushFile(file, result, options, cb);
			} catch (error) {
				return cb(errorHandler(error, file));
			}
		} else {
			sass.render(options, (error, result) => {
				if (error) {
					error = errorHandler(error, file);
					return cb(error);
				}
				pushFile(file, result, options, cb);
			});
		}
	}

	return through2.obj(readBuffer);
}
34936
function() {
            var book = this;

            var styles = book.config.get('styles');

            return _.reduce(styles, function(prev, filename, type) {
                return prev.then(function() {
                    var extension = path.extname(filename).toLowerCase();
                    if (extension != '.sass' && extension != '.scss') return;

                    book.log.info.ln('compile sass file: ', filename);

                    // Temporary CSS file
                    var tmpfile = type+'-'+Date.now()+'.css';

                    // Replace config
                    book.config.set('styles.'+type, tmpfile);

                    return renderSASS(
                        book.resolve(filename),
                        path.resolve(book.options.output, tmpfile)
                    );
                });
            }, Q());
        }
795550
public function output_css( $clear_cache = false ) {
		if ( $clear_cache ) {
			$this->clear_cache( 'style' );
		}
		if ( empty( $this->_css ) ) {
			return;
		}
		ksort( $this->_css );
		$css = implode( "\n", array_map( function ( $s ) {
			return implode( "\n", $s );
		}, $this->_css ) );

		if ( $this->apply_filters( 'minify_css' ) ) {
			$minify = new \MatthiasMullie\Minify\CSS();
			$minify->add( $css );
			echo '<style>' . $minify->minify() . '</style>';
		} else {
			echo '<style>' . $css . '</style>';
		}
		$this->_css = [];
	}
780030
def render_theming_css():
    
    css = getattr(settings, 'ADMIN_TOOLS_THEMING_CSS', False)
    if not css:
        css = '/'.join(['admin_tools', 'css', 'theming.css'])
    return mark_safe(
        '<link rel="stylesheet" type="text/css" media="screen" href="%s" />' %
        staticfiles_storage.url(css)
    )
403659
function buildCSS(src, filename, dest, applyHeader) {
  dest = dest || config.dist.cssPath;
  applyHeader = applyHeader || false;

  return gulp.src(src)
    .pipe(sass({
      includePaths: [config.src.scssPath, config.packagesPath]
    })
      .on('error', sass.logError))
    .pipe(cleanCSS())
    .pipe(autoprefixer({
      // Supported browsers added in package.json ("browserslist")
      cascade: false
    }))
    .pipe(gulpif(applyHeader, header(config.prj.header, {
      config: config
    })))
    // Remove charset rule (if present) and add to the first
    // line of the stylesheet (@charset must be on the first line)
    .pipe(replace('@charset "UTF-8";', ''))
    .pipe(header('@charset "UTF-8";\n'))
    .pipe(rename(filename))
    .pipe(gulp.dest(dest));
}
1353019
function completeOutput(outputCSS = '') {


		if (OPTIONS.css_output !== '') {
			// console.log(outputCSS)


			//write output
			try {
				if (OPTIONS.format_4095_rules_legacy_limit) {
					// console.log(summary.stats.after.noRules)
					var noOutputFilesNeeded = Math.ceil(summary.stats.after.noRules / 4095);
					// console.log(noOutputFilesNeeded)
					

					if (noOutputFilesNeeded == 1) {

						outputCSS = trimCSS(outputCSS);
						outputCSS = restoreHacks(outputCSS);
						write(OPTIONS.css_output, outputCSS);
						filesizeKB = getFilesizeInKiloBytes(OPTIONS.css_output);
					} else { //group 4095 rules

						try {
							var ast = css.parse(outputCSS, { source: fileLocation });
						} catch(err) {
							console.log(error("CSS Parser2 Error: probably have something funny in your CSS, change it then please try again."));
							console.log('Reason: ' + err.reason);
							console.log('Line: ' + err.line);
							console.log('Column: ' + err.column);
							console.log('Filename: ' + err.filename);
							process.exit(1);
						}

						var rulesGroups = [];
						var rulesGroupsLen = 0;
						var rules = ast.stylesheet.rules;
						var ruleslen = rules.length;
						var ruleCount = 0;
						var groupCount = 0;

						for (i = 0; i < ruleslen; ++i) {

							if (rulesGroups[groupCount] === undefined) {
								rulesGroups[groupCount] = [];
							}
							rulesGroups[groupCount].push(rules[i]);
							ruleCount += 1;

							if (ruleCount == 4095) {
								groupCount += 1;
							}
						}
						rulesGroupsLen = rulesGroups.length;
						filesizeKB = 0;
						outputFilename = '';
						for (i = 0; i < rulesGroupsLen; i++) {

							outputAST = {
								type: 'stylesheet',
								stylesheet: {
									rules: rulesGroups[i]
								}
							};
							outputCSS = css.stringify(outputAST);

							outputCSS = trimCSS(outputCSS);
							outputCSS = restoreHacks(outputCSS);
							outputFilename = OPTIONS.css_output.substr(0, OPTIONS.css_output.length-4) + '_' + i + '.css';
							write(outputFilename, outputCSS);

							filesizeKB += getFilesizeInKiloBytes(outputFilename);
						}
					}
					
				} else {
					outputCSS = trimCSS(outputCSS);
					outputCSS = restoreHacks(outputCSS);
					if (OPTIONS.css_output === null || OPTIONS.css_output === undefined || OPTIONS.css_output == '') {
						var size = kiloByteLength(outputCSS);
						filesizeKB = size/1000;
					} else {
						write(OPTIONS.css_output, outputCSS);
						filesizeKB = getFilesizeInKiloBytes(OPTIONS.css_output);
					}
				}
				
			} catch(e) {
				console.log(error("Output file error: Something went wrong while writing the file, check your folder permissions, config_css.json and please try again."));
				console.log(e);
				process.exit(1);
			}

		} else {
			outputCSS = trimCSS(outputCSS);
			outputCSS = restoreHacks(outputCSS);
			filesizeKB = kiloByteLength(outputCSS);
		}

		summary.stats.after.totalFileSizeKB += filesizeKB;
		summary.stats.summary.savingsKB = roundTo(summary.stats.before.totalFileSizeKB - summary.stats.after.totalFileSizeKB, 4);
		summary.stats.summary.savingsPercentage = roundTo(summary.stats.summary.savingsKB / summary.stats.before.totalFileSizeKB * 100, 2);

		//write report
		if (OPTIONS.generate_report) {

			try {
				var cssdata = JSON.stringify(summary, null, '\t');
				write(REPORT_DUPLICATE_CSS, JSON.stringify(summary, null, '\t'));
			} catch(e) {
				console.log(error("Report output file error: Something went wrong while writing the file, check your folder permissions, config_css.json and please try again."));
				console.log(e);
				process.exit(1);
			}
		}

		if (OPTIONS.verbose) {

			console.log(cool('Before: ' + summary.stats.before.totalFileSizeKB + 'KB'));
			console.log(cool('After: ' + summary.stats.after.totalFileSizeKB + 'KB'));
			console.log(cool('Saved: ' + summary.stats.summary.savingsKB + 'KB (' + summary.stats.summary.savingsPercentage + '%)'));

			console.timeEnd(logoRed("Purged " + timeLabel + " in "));
		}

		if (OPTIONS.css_output === null || OPTIONS.css_output === undefined || OPTIONS.css_output == '') {
			return outputCSS;
		} else {

			// console.log(OPTIONS.css_output);
			
		}
	}
976485
function sass() {
  return gulp.src('src/assets/scss/app.scss')
    .pipe($.if(!PRODUCTION, $.sourcemaps.init()))
    .pipe($.sass({
      includePaths: ['node_modules/foundation-emails/scss']
    }).on('error', $.sass.logError))
    .pipe($.if(PRODUCTION, $.uncss(
      {
        html: ['dist/**/*.html']
      })))
    .pipe($.if(!PRODUCTION, $.sourcemaps.write()))
    .pipe(gulp.dest('dist/css'));
}
395150
def css(self):
        
        css_list = [DEFAULT_MARK_CSS]
        for aes in self.aesthetics:
            css_list.extend(get_mark_css(aes, self.values[aes]))
        #print('\n'.join(css_list))
        return '\n'.join(css_list)
1228620
function sass(sassFiles, callback) {
  var sassFile = sassFiles[0];

  if (sassFiles.length > 1) {
    console.warn('STYLES: More than one possible SASS file found, will take main or global.');
    sassFile = _.find(sassFiles, function (file) {
      return Path.basename(file, Path.extname(file)) === 'main' || Path.basename(file, Path.extname(file)) === 'global';
    });
  }

  if (sassFile) {
    Sass.render({file: sassFile, omitSourceMapUrl: true}, function (err, result) {
      if (!err) {
        autoPrefix(result.css, callback);
      }
      else {
        console.error('STYLES: Error rendering SASS file ' + sassFile, err);
        callback && callback();
      }
    });
  }
  else {
    console.warn('STYLES: Could not find appropriate main SASS file, please rename your main stylesheet to main.scss or global.scss.');
    callback && callback();
  }
}
579055
public function output($sType = 'ALL', $bOutput = true)
    {
        $aOut  = [];
        $sType = strtoupper($sType);

        //  Linked Stylesheets
        if (!empty($this->aCss) && ($sType == 'CSS' || $sType == 'ALL')) {

            foreach ($this->aCss as $sAsset) {
                $sAsset = $this->addCacheBuster($sAsset);
                $aOut[] = link_tag($sAsset);
            }
        }

        // --------------------------------------------------------------------------

        //  Linked JS
        if (!empty($this->aJs) && ($sType == 'JS' || $sType == 'ALL')) {

            foreach ($this->aJs as $sAsset) {
                $sAsset = $this->addCacheBuster($sAsset);
                $aOut[] = '<script src="' . $sAsset . '"></script>';
            }
        }

        // --------------------------------------------------------------------------

        //  Inline CSS
        if (!empty($this->aCssInline) && ($sType == 'CSS-INLINE' || $sType == 'ALL')) {

            $aOut[] = '<style type="text/css">';
            foreach ($this->aCssInline as $sAsset) {
                $aOut[] = preg_replace('/<\/?style.*?>/si', '', $sAsset);
            }
            $aOut[] = '</style>';
        }

        // --------------------------------------------------------------------------

        //  Inline JS (Header)
        if (!empty($this->aJsInlineHeader) && ($sType == 'JS-INLINE-HEADER' || $sType == 'ALL')) {
            $aOut[] = '<script>';
            foreach ($this->aJsInlineHeader as $sAsset) {
                $aOut[] = preg_replace('/<\/?script.*?>/si', '', $sAsset);
            }
            $aOut[] = '</script>';
        }

        // --------------------------------------------------------------------------

        //  Inline JS (Footer)
        if (!empty($this->aJsInlineFooter) && ($sType == 'JS-INLINE-FOOTER' || $sType == 'ALL')) {
            $aOut[] = '<script>';
            foreach ($this->aJsInlineFooter as $sAsset) {
                $aOut[] = preg_replace('/<\/?script.*?>/si', '', $sAsset);
            }
            $aOut[] = '</script>';
        }

        // --------------------------------------------------------------------------

        //  Force SSL for assets if page is secure
        if (Functions::isPageSecure()) {
            foreach ($aOut as &$sLine) {
                $sLine = str_replace($this->sBaseUrl, $this->sBaseUrlSecure, $sLine);
            }
        }

        // --------------------------------------------------------------------------

        if ($bOutput) {
            echo implode("\n", $aOut);
        }

        return $aOut;
    }
627881
function compassStyle(input, output) {
    let sassList  = config.sassLib || [],
        inputList = [];
    sassList.forEach((v) => {
        if (!!path.parse(v).dir) {
            inputList.push(v);
        } else {
            try {
                inputList = inputList.concat(require(v).includePaths);
            } catch (err) {
                console.log(`没有找到 ${v} 库`);
            }
        }
    });
    task.src(input)
        .pipe(plumberPlugin())
        .pipe(taskIf(styleType === 'scss', sassPlugin({includePaths: inputList})))
        .pipe(connectPlugin.reload())
        .pipe(task.dest(output));
}
1338240
def to_css
      css_parts = []
      background = [flattened[:background_color].to_s,flattened[:background].to_s].join(" ").strip
      css_parts.push("background: #{background}") if background and background != ""
      css_parts.push("color: #{flattened[:color].to_s}") if flattened[:color]
      css_parts.join("; ")
    end
1186645
function cssTemplate (params) {
  // Localize parameters
  var items = params.items;
  var options = params.options;
  var tmplParams = {
    sprite: null,
    retina: null,
    items: [],
    options: options
  };

  var classFn = function (name, sep) {
    if (options.cssClass) {
      return '.' + cssesc(options.cssClass + sep + name, {isIdentifier: true});
    }
    else {
      return '.icon' + cssesc(sep + name, {isIdentifier: true});
    }
  };

  // Add class to each of the options
  items.forEach(function saveClass (item) {
    if (item.type === 'sprite') {
      item['class'] = classFn('', '');
      tmplParams.sprite = item;
    }
    else if (item.type === 'retina') {
      item['class'] = classFn('', '');
      tmplParams.retina = item;
    }
    else {
      item['class'] = classFn(item.name, '-');
      tmplParams.items.push(item);
    }
  });
  // Render and return CSS
  var tmplFile = options.template ?
    fs.readFileSync(path.resolve(process.cwd(), options.template), 'utf8') :
    tmpl[options.processor];
  var css = mustache.render(tmplFile, tmplParams);
  return css;
}
1236678
def process_styles (out)
      out.gsub /(<style\b[^>]*?>([\s\S]*?)<\/style>)\s*/i do
        css = $2
        m = $1.gsub /^<style\s([^>]+)>/i do |m|
          attrs(m, 'style', true)
        end
        begin
          css_compressed = MultiCss.min css
          m.gsub!(css, css_compressed)
        rescue Exception => e
          log e.message
        end
        reserve m
      end
    end