Package org.lesscss

Examples of org.lesscss.LessCompiler.compile()


    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
    System.out.println(css);

    LessCssCompiler lessCssCompiler = new LessCssCompiler();
    lessCssCompiler.setBuildContext(ThreadBuildContext.getContext());
    lessCssCompiler.setSourceDirectory(new File(PathKit.getWebRootPath() + "/css/"));
View Full Code Here


    // create new source
    final LessSource mainLessSource = new LessSource(lessTargetFile);

    log.info("compiling " + lessTargetFile.getAbsolutePath() + " to " + cssTargetFile.getAbsolutePath());
    lessCompiler.compile(mainLessSource, cssTargetFile, false);
    return mainLessSource;
  }

  /**
   * instantiates the actual less compilement
View Full Code Here

    return false;
  }

  public static void main(String[] args) throws LessException, IOException {
    LessCompiler lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
View Full Code Here

    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
    System.out.println(css);

    LessCssCompiler lessCssCompiler = new LessCssCompiler();
    lessCssCompiler.setBuildContext(ThreadBuildContext.getContext());
    lessCssCompiler.setSourceDirectory(new File(PathKit.getWebRootPath() + "/css/"));
View Full Code Here

  public File convert(URL resource) throws IOException {
    LessCompiler lessCompiler = new LessCompiler();
    try {
      String lessFile = parseLess(resource);
      final String css = lessCompiler.compile(lessFile);
      return createCssFile(css);
    } catch (LessException e) {
      throw new IOException("specified less stylesheet could not be compiled to css", e);
    }
  }
View Full Code Here

    String uri = request.getRequestURI();
    try {
      logger.debug("lessifying: {}", uri);
      LessCompiler less = new LessCompiler();
      String content = IOUtils.toString(reader);
      writer.write(less.compile(content));
    } catch (LessException ex) {
      throw new LessRuntimeException(LessCssError.of(
          uri, ex.getCause()), ex.getCause());
    } finally {
      // Rhino throws an exception when trying to exit twice. Make sure we don't
View Full Code Here

    return false;
  }

  public static void main(String[] args) throws LessException, IOException {
    LessCompiler lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
View Full Code Here

    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
    System.out.println(css);

    LessCssCompiler lessCssCompiler = new LessCssCompiler();
    lessCssCompiler.setBuildContext(ThreadBuildContext.getContext());
    lessCssCompiler.setSourceDirectory(new File(PathKit.getWebRootPath() + "/css/"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.