Parses CSS string source using the current cssBuilder.
        Use for embedded stylesheets.
422320
def parse(self, src):
        """"""

        self.cssBuilder.beginStylesheet()
        try:

            # XXX Some simple preprocessing
            src = cssSpecial.cleanupCSS(src)

            try:
                src, stylesheet = self._parseStylesheet(src)
            except self.ParseError as err:
                err.setFullCSSSource(src)
                raise
        finally:
            self.cssBuilder.endStylesheet()
        return stylesheet
15484
private static void  parseStyle(SvgElementBase obj, String style)
   {
      TextScanner  scan = new TextScanner(style.replaceAll("/\\*.*?\\*/", ""));  // regex strips block comments

      while (true)
      {
         String  propertyName = scan.nextToken(':');
         scan.skipWhitespace();
         if (!scan.consume(':'))
            break;  // Syntax error. Stop processing CSS rules.
         scan.skipWhitespace();
         String  propertyValue = scan.nextTokenWithWhitespace(';');
         if (propertyValue == null)
            break;  // Syntax error
         scan.skipWhitespace();
         if (scan.empty() || scan.consume(';'))
         {
            if (obj.style == null)
               obj.style = new Style();
            processStyleProperty(obj.style, propertyName, propertyValue);
            scan.skipWhitespace();
         }
      }
   }
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
519627
function parseCss (ctx, done) {
  var result
  try {
    result = postcss()
      .process(ctx.src, {
        map: {
          sourcesContent: true,
          annotation: false,
          prev: ctx.map
        },
        from: ctx.filename
      })
    ctx.src = result.css
    ctx.map = result.map.toJSON()
    done(null, ctx)
  } catch (e) {
    var msg = e.message
    var ext = extname(ctx.filename).slice(1).toLowerCase()
    if (ext !== 'css') {
      msg += ' (Try to use appropriate parser for ' + ext + ')'
    }
    done(new Error(msg))
  }
}
414604
async function processCss({ from, to, banner }) {
  const src = await readFile(from, 'utf8');

  const { plugins, options } = await postcssLoadConfig({
    from,
    to,
    map: { inline: false },
  });

  const sourceCss = banner + src;
  const result = await postcss(plugins).process(sourceCss, options);

  compileWarn('PostCSS', 'WARN', result.warnings());

  // minify resulting CSS
  const min = await new CleanCSS({
    level: {
      1: { all: true },
      2: { all: true },
    },
    returnPromise: true,
    sourceMap: true,
  }).minify(result.css, result.map.toString());

  compileWarn('CleanCSS', 'ERR', min.errors);
  compileWarn('CleanCSS', 'WARN', min.warnings);

  // clean-css removes the source map comment so we need to add it back in
  min.styles = `${min.styles}\n/*# sourceMappingURL=${basename(
    options.to,
  )}.map */`;

  writeFile(options.to, min.styles);
  writeFile(`${options.to}.map`, min.sourceMap.toString());

  return {
    min,
    result,
  };
}
1172368
def dumb_css_parser(data):
    """"""
    # remove @import sentences
    data += ';'
    importIndex = data.find('@import')
    while importIndex != -1:
        data = data[0:importIndex] + data[data.find(';', importIndex) + 1:]
        importIndex = data.find('@import')

    # parse the css. reverted from dictionary compehension in order to support older pythons
    elements =  [x.split('{') for x in data.split('}') if '{' in x.strip()]
    try:
        elements = dict([(a.strip(), dumb_property_dict(b)) for a, b in elements])
    except ValueError:
        elements = {} # not that important

    return elements
1360349
public void parseStyleAttribute(final Reader reader, String systemID, final CssErrorHandler err, final CssContentHandler doc) throws
      IOException,
      CssException
  {
    CssTokenIterator iter = scan(reader, systemID, err);
    doc.startDocument();
    while (iter.hasNext())
    {
      CssToken tk = iter.next();
			
			if(MATCH_SEMI.apply(tk)) 
			{
				continue; //starting with ';' is allowed, Issue 238
			}
      try
      {
			
        CssDeclaration decl = handleDeclaration(tk, iter, doc, err, true);
        if (decl != null)
        {
          doc.declaration(decl);
        }
        else
        {
          // #handleDeclaration has issued errors
          return;
        }
      }
      catch (PrematureEOFException te)
      {
        // The subroutines report premature EOF to ErrHandler
        // on occurrence; if the listener rethrows it will
        // be a CssException so we don't catch it here.
        break;
      }
    }
    doc.endDocument();
  }
1038128
def compile_str(contents):
    
    ctx = SASS_CLIB.sass_new_context()
    ctx.contents.source_string = c_char_p(contents)

    SASS_CLIB.compile(ctx)

    if ctx.contents.error_status:
        print(ctx.contents.error_message)

    return ctx.contents.output_string or ""
923750
function(s, v) {
    if (arguments.length == 0) {
      // get full style
      return this.node.style.cssText || ''

    } else if (arguments.length < 2) {
      // apply every style individually if an object is passed
      if (typeof s == 'object') {
        for (v in s) this.style(v, s[v])

      } else if (SVG.regex.isCss.test(s)) {
        // parse css string
        s = s.split(';')

        // apply every definition individually
        for (var i = 0; i < s.length; i++) {
          v = s[i].split(':')
          this.style(v[0].replace(/\s+/g, ''), v[1])
        }
      } else {
        // act as a getter if the first and only argument is not an object
        return this.node.style[camelCase(s)]
      }

    } else {
      this.node.style[camelCase(s)] = v === null || SVG.regex.isBlank.test(v) ? '' : v
    }

    return this
  }
528316
def parse(self, replace=False):
        
        if self.last_parsed is not None \
                and self.last_parsed > os.path.getmtime(self.path) \
                and not replace:
            return
        self.last_parsed = time.time()
        with open(self.path, 'r') as file_:
            for line in file_:
                match = CONFIG_LINE_RE.match(line.rstrip())
                if match:
                    if match.group(1) == 'sass_dir':
                        self.src = os.path.join(
                                self.base_dir, match.group(2)[1:-1])
                    elif match.group(1) == 'css_dir':
                        self.dest = os.path.join(
                                self.base_dir, match.group(2)[1:-1])
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;
}
267093
public CSSStyleSheetImpl parseStyleSheet(final InputSource source, final String href) throws IOException {
        final CSSOMHandler handler = new CSSOMHandler();
        handler.setHref(href);
        parser_.setDocumentHandler(handler);
        parser_.parseStyleSheet(source);
        final Object o = handler.getRoot();
        if (o instanceof CSSStyleSheetImpl) {
            return (CSSStyleSheetImpl) o;
        }
        return null;
    }
529231
function parseCssForImports(link, css) {
    link.imports = resolveCssImportUrls(link.url, css)
    status.total += link.imports.length
    result.css += css

    link.imports.forEach(function(importUrl) {
      var importLink = createLink(importUrl, importUrl)
      result.links.push(importLink)

      getLinkContents(importLink.url, options)
        .then(function(css) {
          handleCssFromLink(importLink, css)
        })
        .catch(function(error) {
          link.error = error
          status.parsed++
          handleResolve()
        })
    })
  }
1206876
private T cssResource(String path) throws IOException {
		return (T) write("<link href=\"../resource/").write(path).write("\" rel=\"stylesheet\" type=\"text/css\" />");
	}
892321
def parse_snippet_css(path)
      return unless core.storage.file?(path)
      parser = ::CssParser::Parser.new
      parser.add_block! core.storage.read(path)
      apply_styles parser, "snippet"
    end
457558
private URL buildUrl(final String styleSheetPath, final boolean skipStylesFolder) {

        URL cssResource = null;

        final List<String> stylePaths = skipStylesFolder ? Collections.singletonList("") : ResourceParameters.STYLE_FOLDER.get();

        for (int i = 0; i < stylePaths.size() && cssResource == null; i++) {

            String stylePath = stylePaths.get(i);
            if (!stylePath.isEmpty()) {
                stylePath += Resources.PATH_SEP;
            }
            cssResource = Thread.currentThread().getContextClassLoader().getResource(stylePath + styleSheetPath);
        }

        if (cssResource == null) {
            LOGGER.error("Style Sheet : {} not found into base folder: {}", styleSheetPath, ResourceParameters.STYLE_FOLDER.get());
        }
        return cssResource;
    }
913142
function parseSpaces(css) {
    var start = pos;

    // Read the string until we meet a non-space character:
    for (; pos < css.length; pos++) {
      if (css.charAt(pos) !== ' ') break;
    }

    // Add a substring containing only spaces to tokens:
    pushToken(TokenType.Space, css.substring(start, pos--), col);
    col += pos - start;
  }