io.bit3.jsass.Options.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中io.bit3.jsass.Options.<init>()方法的一些代码示例,展示了Options.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Options.<init>()方法的具体详情如下:
包路径:io.bit3.jsass.Options
类名称:Options
方法名:<init>

Options.<init>介绍

暂无

代码示例

代码示例来源:origin: jooby-project/jooby

Options options = new Options();
options.setIsIndentedSyntaxSrc("sass".equals(syntax));
options.getImporters().add(new SassImporter(syntax, resolver));

代码示例来源:origin: io.github.javaeden.orchid/OrchidCore

@Inject
public SassCompiler(SassImporter importer) {
  super(800);
  options = new Options();
  options.getImporters().add(importer);
}

代码示例来源:origin: geogebra/geogebra

@Override
protected String process(String css, URL resource) throws Exception {
  URI inputFile = null;
  try {
    inputFile = resource.toURI();
  } catch (URISyntaxException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
  }
  URI outputFile = new File("stylesheet.css").toURI();
  Options options = new Options();
  options.setOutputStyle(OutputStyle.COMPRESSED);
  Output output = new io.bit3.jsass.Compiler().compileString(css,
      inputFile, outputFile, options);
  return output.getCss();
}

代码示例来源:origin: svenkubiak/mangooio

private static void sassify(File sassFile) {
  final File outputFile = getOutputFile(sassFile, Suffix.CSS);
  final URI inputURI = sassFile.toURI();
  final URI outputURI = outputFile.toURI();
  final Compiler compiler = new Compiler();
  try {
   final Output output = compiler.compileFile(inputURI, outputURI, new Options());
   FileUtils.writeStringToFile(outputFile, output.getCss(), Default.ENCODING.toString());
   logPreprocess(sassFile, outputFile);
  } catch (CompilationException | IOException e) {
    LOG.error("Failed to preprocess SASS file", e);
  }
}

代码示例来源:origin: com.blossom-project/blossom-ui-common

@Override
public void doCompileAll() throws Exception {
 this.cache.clear();
 for (Theme theme : registry.getPlugins()) {
  for (String filename : FILENAMES) {
   final String scssPath = String.format("classpath:/scss/%s.scss", filename);
   final URL scssResource = resourceLoader.getResource(scssPath).getURL();
   if (null != scssResource) {
    final String scssCode = IOUtils.toString(scssResource, StandardCharsets.UTF_8);
    Options options = new Options();
    options.setImporters(Collections.singleton(new CustomImporter(theme)));
    final Compiler compiler = new Compiler();
    final Output output = compiler.compileString(
     scssCode,
     new URI(scssPath),
     null,
     options
    );
    cache.put(theme.getName() + "_" + filename, output.getCss());
   }
  }
 }
}

代码示例来源:origin: VueGWT/vue-gwt

private String scssToCss(String scss) {
 Compiler compiler = new Compiler();
 Options options = new Options();
 try {
  StringContext context = new StringContext(scss, this.htmlTemplateUri, null/*outputPath*/,
    options);
  Output output = compiler.compile(context);
  return output.getCss();
 } catch (CompilationException e) {
  logger.error("SCSS compile failed: " + e.getErrorText());
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: com.github.warmuuh/libsass-maven-plugin

private Options getConfiguredOptions(String inputPathAbsolute, String sourceMapPathRelativeToInput) {
  Options opt = new Options();
  if(includePaths != null) {
    for (String path : includePaths.split(";")) {
      opt.getIncludePaths().add(new File(path));
    }
  }
  String allIncludePaths = new File(inputPathAbsolute).getParent();
  opt.getIncludePaths().add(new File(allIncludePaths));
  opt.setIsIndentedSyntaxSrc(inputSyntax == sass);
  opt.setOutputStyle(outputStyle);
  opt.setSourceComments(generateSourceComments);
  opt.setPrecision(precision);
  if (generateSourceMap) {
    opt.setSourceMapFile(new File(sourceMapPathRelativeToInput).toURI());
    opt.setSourceMapContents(embedSourceContentsInSourceMap);
    opt.setSourceMapEmbed(embedSourceMapInCSS);
    opt.setOmitSourceMapUrl(omitSourceMappingURL);
  } else {
    opt.setSourceMapContents(false);
    opt.setSourceMapEmbed(false);
    opt.setOmitSourceMapUrl(true);
  }
  if (enableClasspathAwareImporter) {
    opt.getImporters().add(new ClasspathAwareImporter());
  }
  return opt;
}

代码示例来源:origin: warmuuh/libsass-maven-plugin

private Options getConfiguredOptions(String inputPathAbsolute, String sourceMapPathRelativeToInput) {
  Options opt = new Options();
  if(includePaths != null) {
    for (String path : includePaths.split(";")) {
      opt.getIncludePaths().add(new File(path));
    }
  }
  String allIncludePaths = new File(inputPathAbsolute).getParent();
  opt.getIncludePaths().add(new File(allIncludePaths));
  opt.setIsIndentedSyntaxSrc(inputSyntax == sass);
  opt.setOutputStyle(outputStyle);
  opt.setSourceComments(generateSourceComments);
  opt.setPrecision(precision);
  if (generateSourceMap) {
    opt.setSourceMapFile(new File(sourceMapPathRelativeToInput).toURI());
    opt.setSourceMapContents(embedSourceContentsInSourceMap);
    opt.setSourceMapEmbed(embedSourceMapInCSS);
    opt.setOmitSourceMapUrl(omitSourceMappingURL);
  } else {
    opt.setSourceMapContents(false);
    opt.setSourceMapEmbed(false);
    opt.setOmitSourceMapUrl(true);
  }
  if (enableClasspathAwareImporter) {
    opt.getImporters().add(new ClasspathAwareImporter());
  }
  return opt;
}

代码示例来源:origin: mickleroy/aem-sass-compiler

@Override
public void compile(Collection<ScriptResource> scriptResources, Writer out, CompilerContext ctx) throws IOException {
  long t0 = System.currentTimeMillis();
  for(ScriptResource src : scriptResources) {
    String scss = ScriptResourceUtil.retrieveContents(src);
    try {
      Options options = new Options();
      options.getImporters().add(new FileImporter(ctx, src.getName()));
      Output output = compiler.compileString(scss, options);
      String css = output.getCss();
      css = Utils.rewriteUrlsInCss(ctx.getDestinationPath(), src.getName(), css);
      out.write(css);
    } catch (CompilationException e) {
      dumpError(out, src.getName(), e.getErrorMessage());
    }
  }
  long t1 = System.currentTimeMillis();
  log.info("Compiled Sass in {}ms", t1 - t0);
}

代码示例来源:origin: org.daisy.pipeline.modules.braille/css-utils

if (url.toString().endsWith(".scss")) {
  Compiler sassCompiler = new Compiler();
  Options options = new Options();
  options.setIsIndentedSyntaxSrc(false);
  options.setOutputStyle(OutputStyle.EXPANDED);

代码示例来源:origin: io.freefair.gradle/jsass-gradle-plugin

@TaskAction
public void compileSass() {
  Compiler compiler = new Compiler();
  Options options = new Options();

代码示例来源:origin: io.freefair.gradle/jsass-plugin

@TaskAction
public void compileSass() {
  Compiler compiler = new Compiler();
  Options options = new Options();

相关文章