Compile the given SASS file into CSS
14407
def compile_sass(self, sass_filename, sass_fileurl):
        
        compile_kwargs = {
            'filename': sass_filename,
            'include_paths': SassProcessor.include_paths + APPS_INCLUDE_DIRS,
            'custom_functions': get_custom_functions(),
        }
        if self.sass_precision:
            compile_kwargs['precision'] = self.sass_precision
        if self.sass_output_style:
            compile_kwargs['output_style'] = self.sass_output_style
        content = sass.compile(**compile_kwargs)
        self.save_to_destination(content, sass_filename, sass_fileurl)
        self.processed_files.append(sass_filename)
        if self.verbosity > 1:
            self.stdout.write("Compiled SASS/SCSS file: '{0}'\n".format(sass_filename))
656859
function () {
    // render stylesheets
    var precss = fs.readFileSync(__dirname + '/themes/default/styl/default.styl', 'utf8');
    stylus.render(precss, { filename: 'default.css' }, function(err, css){
      if (err) {
        throw err;
      }

      this.styles = css;
    }.bind(this));

    // collect client js (to be inined later)
    this.js = fs.readFileSync(__dirname + '/themes/default/js/default.js', 'utf8');

    // register handlebars helpers
    Handlebars.registerHelper('roundNumber', function (number) {
      return Math.round(number * Math.pow(10, 2)) / Math.pow(10, 2);
    });

    // collect & compile templates
    this.templates = {};
    this.templates.test = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/test.hbs', 'utf8'));
    this.templates.wrapper = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/wrapper.hbs', 'utf8'));
    this.templates.testresult = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/tests.hbs', 'utf8'));
    this.templates.banner = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/banner.hbs', 'utf8'));
    this.templates.detail = Handlebars.compile(fs.readFileSync(__dirname + '/themes/default/hbs/detail.hbs', 'utf8'));

    return this;
  }
1088003
def to_css
      css = ''
      css << resolved_modifier
      css << ' ' unless resolved_modifier.empty?
      css << resolved_type
      css << ' and ' unless resolved_type.empty? || expressions.empty?
      css << expressions.map do |e|
        # It's possible for there to be script nodes in Expressions even when
        # we're converting to CSS in the case where we parsed the document as
        # CSS originally (as in css_test.rb).
        e.map {|c| c.is_a?(Sass::Script::Tree::Node) ? c.to_sass : c.to_s}.join
      end.join(' and ')
      css
    end
840484
function buildStyles() {
  return Promise.resolve()
    // Create the dist folder if it doesn't exist
    .then(() => {
      if(!FS.existsSync(Path.join(__dirname, 'dist'))) {
        return FS.mkdirAsync(Path.join(__dirname, 'dist'));
      }
    })

    // Generate minified stylesheet
    .then(() => {
      let file = Path.join(__dirname, 'source/css/shoelace.css');
      let css = FS.readFileSync(file, 'utf8');

      return PostCSS([
        AtImport,
        CSSnext({
          features: {
            rem: false
          }
        }),
        CSSnano({
          autoprefixer: false,
          safe: true
        })
      ]).process(css, { from: file });
    })

    // Write stylesheet to dist
    .then((result) => {
      let file = Path.join(__dirname, 'dist/shoelace.css');

      // Update {{version}} in CSS since it's not processed with Handlebars
      result.css = result.css.replace(/\{\{version\}\}/g, __version);

      // Output a message
      console.log(Chalk.green('CSS processed: %s! 🦋'), Path.relative(__dirname, file));

      // Write output file
      return FS.writeFileAsync(file, result.css, 'utf8');
    });
}
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());
        }
3352
function cssToSss (css, file) {
    if (path.extname(file) === '.css') {
      return postcss().process(css, { stringifier: sugarss }).then(function (result) {
        return result.css
      })
    } else {
      return css
    }
  }
621377
function read(file, opts) {
	var encoding = opts.encoding || 'utf8';
	var data = opts.transform(fs.readFileSync(file, encoding));
	return css.parse(data, {source: file}).stylesheet;
}
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)
1225847
def from_css(Class, csstext, encoding=None, href=None, media=None, title=None, validate=None):
        
        styles = Class()
        cssStyleSheet = cssutils.parseString(csstext, encoding=encoding, href=href, media=media, title=title, validate=validate)
        for rule in cssStyleSheet.cssRules:
            if rule.type==cssutils.css.CSSRule.FONT_FACE_RULE:
                if styles.get('@font-face') is None: styles['@font-face'] = []
                styles['@font-face'].append(Class.styleProperties(rule.style))
            
            elif rule.type==cssutils.css.CSSRule.IMPORT_RULE:
                if styles.get('@import') is None: styles['@import'] = []
                styles['@import'].append("url(%s)" % rule.href)

            elif rule.type==cssutils.css.CSSRule.NAMESPACE_RULE:
                if styles.get('@namespace') is None: styles['@namespace'] = {}
                styles['@namespace'][rule.prefix] = rule.namespaceURI
            
            elif rule.type==cssutils.css.CSSRule.MEDIA_RULE:
                if styles.get('@media') is None: styles['@media'] = []
                styles['@media'].append(rule.cssText)
            
            elif rule.type==cssutils.css.CSSRule.PAGE_RULE:
                if styles.get('@page') is None: styles['@page'] = []
                styles['@page'].append(rule.cssText)

            elif rule.type==cssutils.css.CSSRule.STYLE_RULE:
                for selector in rule.selectorList:
                    sel = selector.selectorText
                    if sel not in styles:
                        styles[sel] = Class.styleProperties(rule.style)
            
            elif rule.type==cssutils.css.CSSRule.CHARSET_RULE:
                styles['@charset'] = rule.encoding

            elif rule.type==cssutils.css.CSSRule.COMMENT:   # comments are thrown away
                pass

            elif rule.type==cssutils.css.CSSRule.VARIABLES_RULE:
                pass
            
            else:
                log.warning("Unknown rule type: %r" % rule.cssText)

        return styles
296991
function compileSass() {
  var stream = gulp.src(src.scss)
    .pipe(plugins.sourcemaps.init())
    .pipe(plugins.sass().on('error', plugins.sass.logError))
    .pipe(plugins.autoprefixer({ browsers: ['last 2 versions', 'ie >= 9'] }))
    .pipe(plugins.sourcemaps.write())
    .pipe(gulp.dest(compiled.css))
    .pipe(reload({ stream: true }));
  return stream;
}
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'));
}
1009020
def compile_markdown_file(source_file):
  ''''''
  template = pkg_resources.resource_string('md2remark.resources.templates', 'slideshow.mustache')

  renderer = pystache.Renderer(search_dirs='./templates')

  f = open(source_file, 'r')
  slideshow_md = f.read()
  f.close()
  slideshow_name = os.path.split(source_file)[1].split('.')[0]

  rendered_text = renderer.render(template, {'title': slideshow_name, 'slideshow': slideshow_md})  

  if not os.path.exists('md2remark_build'):
    os.makedirs('md2remark_build')
  
  f = open(os.path.join('md2remark_build', slideshow_name + '.html'), 'w')
  f.write(rendered_text)
  f.close()
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;
}
606546
function compileSass() {
    let tasks = [];

    Object.keys(config).forEach((key) => {
        let val = config[key];
        tasks.push(gulp.src(val.src)
            .pipe(plumber({ errorHandler: handleErrors }))
            .pipe(sourcemaps.init())
            .pipe(sass(config.settings))
            .pipe(sourcemaps.write('./'))
            .pipe(gulp.dest(val.dest)));
    });

    return merge(tasks);
}
1309788
def _cached_css_compile(pattern, namespaces, custom, flags):
    """"""

    custom_selectors = process_custom(custom)
    return cm.SoupSieve(
        pattern,
        CSSParser(pattern, custom=custom_selectors, flags=flags).process_selectors(),
        namespaces,
        custom,
        flags
    )
126882
function sassCompile() {
    gulp.src(sassSrcFiles)
    .pipe(sourcemaps.init())
    .pipe(sass(sassOptions).on('error', sass.logError))
    .pipe(autoprefixer(autoprefixerOptions))
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest('./dist/crudl-ui/css'))
}
1356894
function compileCss(src, dest) {
  gulp
    .src(src)
    .pipe(plumber(config.plumberOptions))
    .pipe(gulpif(!config.production, sourcemaps.init()))
    .pipe(sass({
      outputStyle: config.production ? 'compressed' : 'expanded',
      precision: 5
    }))
    .pipe(postcss(processors))
    .pipe(gulpif(config.production, rename({
      suffix: '.min',
      extname: '.css'
    })))
    .pipe(gulpif(!config.production, sourcemaps.write()))
    .pipe(gulp.dest(dest));
}