Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Keep order of CSS Files #11

Open
SebastianSchroeder opened this issue Aug 25, 2013 · 3 comments
Open

Keep order of CSS Files #11

SebastianSchroeder opened this issue Aug 25, 2013 · 3 comments

Comments

@SebastianSchroeder
Copy link

Hey,

I want to use the plugin but it does not keep the order of the input css files when combining them. When I input 1.css and 2.css to be combined to all.css I want to have the content 1.css first in the file and then 2.css.

Would be great if you could incorporate this.

Cheers,
Sebastian

@Anubh
Copy link

Anubh commented Sep 22, 2014

Hi,

Is there any solution for this problem ?? Basically i wants to keep my css files in order. But I am not able todo such thing. If there is any solution let me know.

Ty

@jonbettinger
Copy link

You can combine files in order using a list of sources.

css.source {
  bootstrap {
    css {
      srcDir "build/webjars/bootstrap/$BOOTSTRAP_VERSION/dist/css"
      include "bootstrap.css"
    }
  }
}
css.source {
  datepicker {
    css {
      srcDir "build/webjars/bootstrap-datepicker/$BOOTSTRAP_DATEPICKER_VERSION/css"
      include "bootstrap-datepicker3.css"
    }
  }
}
css.source {
  main {
    css {
      srcDir "src/main/webapp/assets/css"
      include "main.css"
    }
  }
}
combineCss {
  source = [css.source.bootstrap.css.files, css.source.datepicker.css.files, css.source.main.css.files] 
  dest = "${buildDir}/css/all.css"
}

@Neonchen
Copy link

Neonchen commented Mar 9, 2016

Found another way:

combineCss {
    source = ["app/styles/file1.css","app/styles/file2.css"]
    dest = "${buildDir}/all.css"
}

Or if you like to remove the redundant path:

def cssDir = "app/styles/"
def cssSrc = ["file1.css","file2.css"]

combineCss {
    source = cssSrc.collect {cssDir+it}
    dest = "${buildDir}/all.css"
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants